Wild Life  2.30
 All Data Structures Files Functions Variables Typedefs Macros
Data Structures | Macros | Typedefs | Functions | Variables
xpred.c File Reference

x windows predicates More...

Go to the source code of this file.

Data Structures

struct  wl_EventClosure
 

Macros

#define stdin_fileno   fileno(stdin)
 
#define CR   0x0d
 
#define BS   0x08
 
#define DrawableGC(w)   (GC)GetIntAttr(GetPsiAttr(w,"graphic_context"),"id")
 
#define WindowDisplayList(w)   GetIntAttr(GetPsiAttr(w,"display_list"),"id")
 
#define DISP(X)   (Display *)val[X]
 
#define DRAW(X)   (Drawable)val[X]
 
#define WIND(X)   (Window)val[X]
 
#define GCVAL(X)   (GC)val[X]
 
#define FONT(X)   (Font)val[X]
 
#define CMAP(X)   (Colormap)val[X]
 
#define STRG(X)   ((char *)val[X])
 

Typedefs

typedef struct wl_EventClosure EventClosure
 

Functions

static int x_handle_error (Display *display, XErrorEvent *x_error)
 x_handle_error More...
 
static int x_handle_fatal_error (Display *display)
 x_handle_fatal_error More...
 
void bk_stack_add_int_attr (ptr_psi_term t, char *attrname, long value)
 bk_stack_add_int_attr More...
 
void bk_change_psi_attr (ptr_psi_term t, char *attrname, ptr_psi_term value)
 bk_change_psi_attr More...
 
long unify_int_result (ptr_psi_term t, long v)
 unify_int_result More...
 
static ptr_psi_term NewPsi (ptr_definition t, char *f, long v)
 ptr_psi_term NewPsi More...
 
long GetIntAttr (ptr_psi_term psiTerm, char *attributeName)
 GetIntAttr. More...
 
ptr_psi_term GetPsiAttr (ptr_psi_term psiTerm, char *attributeName)
 GetPsiAttr. More...
 
static void ResizePixmap (ptr_psi_term psi_window, Display *display, Window window, unsigned long width, unsigned long height)
 ResizePixmap. More...
 
static void FreeWindow (Display *display, ptr_psi_term psi_window)
 FreeWindow. More...
 
long xcOpenConnection ()
 xcOpenConnection More...
 
long xcDefaultRootWindow ()
 xcDefaultRootWindow More...
 
static long GetConnectionAttribute (Display *display, long attributeId, long *attribute)
 GetConnectionAttribute. More...
 
long xcGetConnectionAttribute ()
 xcGetConnectionAttribute More...
 
static long GetScreenAttribute (Display *display, long screen, long attributeId, long *attribute)
 GetScreenAttribute. More...
 
long xcGetScreenAttribute ()
 xcGetScreenAttribute More...
 
long xcCloseConnection ()
 xcCloseConnection More...
 
long xcCreateSimpleWindow ()
 xcCreateSimpleWindow More...
 
long xcSetStandardProperties ()
 xcSetStandardProperties More...
 
long xcGetWindowGeometry ()
 xcGetWindowGeometry More...
 
static long GetWindowAttribute (Display *display, long window, long attributeId, long *attribute)
 GetWindowAttribute. More...
 
long xcGetWindowAttribute ()
 xcGetWindowAttribute More...
 
long xcSetWindowGeometry ()
 xcSetWindowGeometry More...
 
long xcMoveWindow ()
 xcMoveWindow More...
 
static long SetWindowAttribute (ptr_psi_term psi_window, Display *display, Drawable window, unsigned long attributeId, unsigned long attribute)
 SetWindowAttribute. More...
 
long xcSetWindowAttribute ()
 xcSetWindowAttribute More...
 
long xcMapWindow ()
 xcMapWindow More...
 
long xcRaiseWindow ()
 xcRaiseWindow More...
 
long xcUnmapWindow ()
 xcUnmapWindow More...
 
long xcMapSubwindows ()
 xcMapSubwindows More...
 
long xcUnmapSubwindows ()
 xcUnmapSubwindows More...
 
long xcClearWindow ()
 xcClearWindow More...
 
long xcResizeWindowPixmap ()
 xcResizeWindowPixmap More...
 
long xcSelectInput ()
 xcSelectInput More...
 
long xcRefreshWindow ()
 xcRefreshWindow More...
 
long xcPostScriptWindow ()
 xcPostScriptWindow More...
 
long xcDestroyWindow ()
 xcDestroyWindow More...
 
long xcCreateGC ()
 xcCreateGC More...
 
static long GetGCAttribute (GC gc, long attributeId, long *attribute)
 GetGCAttribute. More...
 
long xcGetGCAttribute ()
 xcGetGCAttribute More...
 
static long SetGCAttribute (Display *display, GC gc, long attributeId, long attribute)
 SetGCAttribute. More...
 
long xcSetGCAttribute ()
 xcSetGCAttribute More...
 
long xcDestroyGC ()
 xcDestroyGC More...
 
long xcRequestColor ()
 xcRequestColor More...
 
long xcRequestNamedColor ()
 xcRequestNamedColor More...
 
long xcFreeColor ()
 xcFreeColor More...
 
long xcDrawLine ()
 xcDrawLine More...
 
long xcDrawArc ()
 xcDrawArc More...
 
long xcDrawRectangle ()
 xcDrawRectangle More...
 
long xcFillRectangle ()
 xcFillRectangle More...
 
long xcFillArc ()
 xcFillArc More...
 
long xcPointsAlloc ()
 xcPointsAlloc More...
 
long xcCoordPut ()
 xcCoordPut More...
 
long xcPointsFree ()
 xcPointsFree More...
 
long xcDrawPolygon ()
 xcDrawPolygon More...
 
long xcFillPolygon ()
 xcFillPolygon More...
 
long xcLoadFont ()
 xcLoadFont More...
 
long xcUnloadFont ()
 xcUnloadFont More...
 
long xcDrawString ()
 xcDrawString More...
 
long xcDrawImageString ()
 xcDrawImageString More...
 
long xcStringWidth ()
 xcStringWidth More...
 
long xcSync ()
 xcSync More...
 
static ptr_psi_term xcEventToPsiTerm (XEvent *event)
 xcEventToPsiTerm More...
 
long list_is_nil (ptr_psi_term lst)
 
ptr_psi_term list_cdr (ptr_psi_term lst)
 list_cdr More...
 
ptr_psi_term list_car (ptr_psi_term lst)
 list_car More...
 
void list_set_car (ptr_psi_term lst, ptr_psi_term value)
 list_set_car More...
 
void list_set_cdr (ptr_psi_term lst, ptr_psi_term value)
 list_set_cdr More...
 
ptr_psi_term list_last_cdr (ptr_psi_term lst)
 list_last_cdr More...
 
ptr_psi_term append_to_list (ptr_psi_term lst, ptr_psi_term value)
 append_to_list More...
 
long map_funct_over_list (ptr_psi_term lst, long(*proc)(), long *closure)
 map_funct_over_list More...
 
long map_funct_over_cars (ptr_psi_term lst, long(*proc)(), long *closure)
 map_funct_over_cars More...
 
void list_remove_value (ptr_psi_term lst, ptr_psi_term value)
 list_remove_value More...
 
static long x_union_event (ptr_psi_term psiEvent, EventClosure *closure)
 x_union_event More...
 
long xcGetEvent ()
 xcGetEvent More...
 
static long x_flush_event (ptr_psi_term eventElt, EventClosure *closure)
 x_flush_event More...
 
long xcFlushEvents ()
 xcFlushEvents More...
 
long xcQueryPointer ()
 xcQueryPointer More...
 
void x_setup_builtins ()
 x_setup_builtins More...
 
static long WaitNextEvent (long *ptreventflag)
 WaitNextEvent. More...
 
long x_read_stdin_or_event (long *ptreventflag)
 x_read_stdin_or_event More...
 
static long mask_match_type (long mask, long type)
 mask_match_type More...
 
static ptr_psi_term x_what_psi_event (ptr_psi_term beginSpan, ptr_psi_term endSpan, long eventType)
 x_what_psi_event More...
 
static void x_build_existing_event (XEvent *event, ptr_psi_term beginSpan, ptr_psi_term endSpan, long eventType)
 x_build_existing_event More...
 
static long x_next_event_span (ptr_psi_term eventElt, EventClosure *eventClosure)
 x_next_event_span More...
 
long x_exist_event ()
 x_exist_event More...
 
void x_destroy_window (Display *display, Window window)
 x_destroy_window More...
 
void x_show_window (Display *display, long window)
 x_show_window More...
 
void x_hide_window (Display *display, long window)
 x_hide_window More...
 
void x_show_subwindow (Display *display, long window)
 x_show_subwindow More...
 
void x_hide_subwindow (Display *display, long window)
 x_hide_subwindow More...
 
long xcQueryTextExtents ()
 xcQueryTextExtents More...
 
ptr_goal GoalFromPsiTerm (ptr_psi_term psiTerm)
 GoalFromPsiTerm. More...
 

Variables

ptr_psi_term xevent_existing = NULL
 
ptr_psi_term xevent_list = NULL
 
ptr_definition xevent
 
ptr_definition xkeyboard_event
 
ptr_definition xbutton_event
 
ptr_definition xexpose_event
 
ptr_definition xdestroy_event
 
ptr_definition xmotion_event
 
ptr_definition xenter_event
 
ptr_definition xleave_event
 
ptr_definition xmisc_event
 
ptr_definition xdisplay
 
ptr_definition xdrawable
 
ptr_definition xwindow
 
ptr_definition xpixmap
 
ptr_definition xconfigure_event
 
ptr_definition xgc
 
ptr_definition xdisplaylist
 
long x_window_creation = FALSE
 
static long xevent_mask []
 
static char * xevent_name []
 

Detailed Description

x windows predicates

Definition in file xpred.c.

Macro Definition Documentation

#define BS   0x08

Definition at line 26 of file xpred.c.

#define CMAP (   X)    (Colormap)val[X]

Definition at line 154 of file xpred.c.

#define CR   0x0d

Definition at line 25 of file xpred.c.

#define DISP (   X)    (Display *)val[X]

Definition at line 149 of file xpred.c.

#define DRAW (   X)    (Drawable)val[X]

Definition at line 150 of file xpred.c.

#define DrawableGC (   w)    (GC)GetIntAttr(GetPsiAttr(w,"graphic_context"),"id")

Definition at line 145 of file xpred.c.

#define FONT (   X)    (Font)val[X]

Definition at line 153 of file xpred.c.

#define GCVAL (   X)    (GC)val[X]

Definition at line 152 of file xpred.c.

#define stdin_fileno   fileno(stdin)

Definition at line 24 of file xpred.c.

#define STRG (   X)    ((char *)val[X])

Definition at line 155 of file xpred.c.

#define WIND (   X)    (Window)val[X]

Definition at line 151 of file xpred.c.

#define WindowDisplayList (   w)    GetIntAttr(GetPsiAttr(w,"display_list"),"id")

Definition at line 146 of file xpred.c.

Typedef Documentation

typedef struct wl_EventClosure EventClosure

Function Documentation

ptr_psi_term append_to_list ( ptr_psi_term  lst,
ptr_psi_term  value 
)

append_to_list

Parameters
lst- ptr_psi_term lst
value- ptr_psi_term value

Definition at line 3035 of file xpred.c.

References wl_psi_term::coref, list_last_cdr(), psi_term_ptr, push_ptr_value_global(), stack_cons(), and stack_nil().

3036 {
3037  ptr_psi_term end;
3038 
3039  end=list_last_cdr(lst);
3041  end->coref=stack_cons(value,stack_nil());
3042  return end->coref;
3043 }
ptr_psi_term stack_cons(ptr_psi_term head, ptr_psi_term tail)
stack_cons
Definition: built_ins.c:46
ptr_psi_term list_last_cdr(ptr_psi_term lst)
list_last_cdr
Definition: xpred.c:3019
void push_ptr_value_global(type_ptr t, GENERIC *p)
push_ptr_value_global
Definition: login.c:523
unsigned long * GENERIC
unsigned long *GENERIC
Definition: def_struct.h:35
ptr_psi_term stack_nil()
stack_nil
Definition: built_ins.c:26
ptr_psi_term coref
Definition: def_struct.h:188
#define psi_term_ptr
values of type_ptr
Definition: def_const.h:383
void bk_change_psi_attr ( ptr_psi_term  t,
char *  attrname,
ptr_psi_term  value 
)

bk_change_psi_attr

Parameters
t- ptr_psi_term t
attrname- char *attrname
value- ptr_psi_term value

Definition at line 240 of file xpred.c.

References wl_psi_term::attr_list, bk_stack_insert(), wl_psi_term::coref, wl_node::data, deref_ptr, FEATCMP, find(), and heap_copy_string().

241 {
242  ptr_psi_term t1;
243  ptr_node n;
244  char *perm;
245 
246 
247  perm=(char *)heap_copy_string(attrname);
248  n=find(FEATCMP,perm,t->attr_list);
249  if(n) {
250  t1=(ptr_psi_term)n->data;
251  deref_ptr(t1);
252  *t1= *value;
253  /*push_ptr_value(psi_term_ptr,(GENERIC *)&(t1->coref));*/
254  if(value!=t1)
255  value->coref=t1;
256  }
257  else
258  bk_stack_insert(FEATCMP,perm,&(t->attr_list),(GENERIC)value);
259 }
#define FEATCMP
indicates to use featcmp for comparison (in trees.c)
Definition: def_const.h:979
ptr_node bk_stack_insert(long comp, char *keystr, ptr_node *tree, GENERIC info)
bk_stack_insert
Definition: trees.c:357
struct wl_psi_term * ptr_psi_term
quotedStackCopy
Definition: def_struct.h:62
GENERIC data
Definition: def_struct.h:201
unsigned long * GENERIC
unsigned long *GENERIC
Definition: def_struct.h:35
#define deref_ptr(P)
Definition: def_macro.h:100
char * heap_copy_string(char *s)
heap_copy_string
Definition: trees.c:172
ptr_psi_term coref
Definition: def_struct.h:188
ptr_node find(long comp, char *keystr, ptr_node tree)
find
Definition: trees.c:394
ptr_node attr_list
Definition: def_struct.h:187
void bk_stack_add_int_attr ( ptr_psi_term  t,
char *  attrname,
long  value 
)

bk_stack_add_int_attr

Parameters
t- ptr_psi_term t
attrname- char * attrname
value- long value

Definition at line 206 of file xpred.c.

References wl_psi_term::attr_list, bk_stack_insert(), wl_node::data, deref_ptr, FEATCMP, find(), heap_alloc(), heap_copy_string(), int_ptr, integer, push_ptr_value(), REAL, stack_psi_term(), wl_psi_term::type, and wl_psi_term::value_3.

207 {
208  ptr_psi_term t1;
209  ptr_node n;
210  char *perm;
211 
212  perm=(char *)heap_copy_string(attrname);
213  n=find(FEATCMP,perm,t->attr_list);
214  if(n) {
215  t1=(ptr_psi_term)n->data;
216  deref_ptr(t1);
217  if(!t1->value_3) {
219  t1->value_3=heap_alloc(sizeof(REAL));
220  }
221  *((REAL *)(t1->value_3)) = *(REAL *) value; // debugged 12/11/2016 DJD
222  }
223  else {
224  t1=stack_psi_term(4);
225  t1->type=integer;
226  t1->value_3=heap_alloc(sizeof(REAL));
227  *((REAL *)(t1->value_3)) = *(REAL *) value; // debugged 12/11/2016 DJD
228  bk_stack_insert(FEATCMP,perm,&(t->attr_list),(GENERIC)t1);
229  }
230 }
void push_ptr_value(type_ptr t, GENERIC *p)
push_ptr_value
Definition: login.c:383
#define FEATCMP
indicates to use featcmp for comparison (in trees.c)
Definition: def_const.h:979
ptr_definition integer
symbol in bi module
Definition: def_glob.h:312
ptr_node bk_stack_insert(long comp, char *keystr, ptr_node *tree, GENERIC info)
bk_stack_insert
Definition: trees.c:357
struct wl_psi_term * ptr_psi_term
quotedStackCopy
Definition: def_struct.h:62
GENERIC data
Definition: def_struct.h:201
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
Definition: def_const.h:132
unsigned long * GENERIC
unsigned long *GENERIC
Definition: def_struct.h:35
#define deref_ptr(P)
Definition: def_macro.h:100
char * heap_copy_string(char *s)
heap_copy_string
Definition: trees.c:172
ptr_psi_term stack_psi_term(long stat)
stack_psi_term
Definition: lefun.c:21
GENERIC value_3
Definition: def_struct.h:186
ptr_node find(long comp, char *keystr, ptr_node tree)
find
Definition: trees.c:394
ptr_definition type
Definition: def_struct.h:181
ptr_node attr_list
Definition: def_struct.h:187
GENERIC heap_alloc(long s)
heap_alloc
Definition: memory.c:1616
#define int_ptr
values of type_ptr
Definition: def_const.h:397
static void FreeWindow ( Display *  display,
ptr_psi_term  psi_window 
)
static

FreeWindow.

Parameters
display- Display *display
psi_window- ptr_psi_term psi_window

Static free all attributes of a window,that is: its display list,its gc, its pixmap ...

Definition at line 463 of file xpred.c.

References DrawableGC, GetIntAttr(), GetPsiAttr(), WindowDisplayList, and x_free_display_list().

464 {
465  ptr_psi_term psiPixmap;
466 
467 
468  XFreeGC(display,DrawableGC(psi_window));
470 
471  psiPixmap = GetPsiAttr(psi_window,"pixmap");
472  XFreeGC(display,DrawableGC(psiPixmap));
473  XFreePixmap(display,GetIntAttr(psiPixmap,"id"));
474 }
#define WindowDisplayList(w)
Definition: xpred.c:146
ptr_psi_term GetPsiAttr(ptr_psi_term psiTerm, char *attributeName)
GetPsiAttr.
Definition: xpred.c:367
#define DrawableGC(w)
Definition: xpred.c:145
void x_free_display_list(ListHeader *displaylist)
x_free_display_list
Definition: xdisplaylist.c:548
long GetIntAttr(ptr_psi_term psiTerm, char *attributeName)
GetIntAttr.
Definition: xpred.c:333
static long GetConnectionAttribute ( Display *  display,
long  attributeId,
long *  attribute 
)
static

GetConnectionAttribute.

Parameters
display- Display *display
attributeId- long attributeId
attribute- long *attribute

static GetConnectionAttribute

Definition at line 560 of file xpred.c.

References FALSE, and TRUE.

561 {
562  switch(attributeId)
563  {
564  case 0:
565  *attribute =(unsigned long) ConnectionNumber(display);
566  break;
567  case 1:
568 #ifndef __alpha
569  *attribute = display->proto_major_version;
570 #endif
571  break;
572  case 2:
573 #ifndef __alpha
574  *attribute =(unsigned long)(display->proto_minor_version);
575 #endif
576  break;
577  case 3:
578  *attribute =(unsigned long) ServerVendor(display);
579  break;
580  case 4:
581  *attribute =(unsigned long) ImageByteOrder(display);
582  break;
583  case 5:
584  *attribute =(unsigned long) BitmapUnit(display);
585  break;
586  case 6:
587  *attribute =(unsigned long) BitmapPad(display);
588  break;
589  case 7:
590  *attribute =(unsigned long) BitmapBitOrder(display);
591  break;
592  case 8:
593  *attribute =(unsigned long) VendorRelease(display);
594  break;
595  case 9:
596 #ifndef __alpha
597  *attribute =(unsigned long)(display->qlen);
598 #endif
599  break;
600  case 10:
601  *attribute =(unsigned long) LastKnownRequestProcessed(display);
602  break;
603  case 11:
604 #ifndef __alpha
605  *attribute =(unsigned long)(display->request);
606 #endif
607  break;
608  case 12:
609  *attribute =(unsigned long) DisplayString(display);
610  break;
611  case 13:
612  *attribute =(unsigned long) DefaultScreen(display);
613  break;
614  case 14:
615 #ifndef __alpha
616  *attribute =(unsigned long)(display->min_keycode);
617 #endif
618  break;
619  case 15:
620 #ifndef __alpha
621  *attribute =(unsigned long)(display->max_keycode);
622 #endif
623  break;
624  default:
625  return FALSE;
626  break;
627  }
628 
629  return TRUE;
630 }
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
static long GetGCAttribute ( GC  gc,
long  attributeId,
long *  attribute 
)
static

GetGCAttribute.

Parameters
gc- GC gc
attributeId- long attributeId
attribute- long *attribute

GETGCATTRIBUTE

Definition at line 1846 of file xpred.c.

References FALSE, and TRUE.

1847 {
1848 #ifndef __alpha
1849  switch(attributeId)
1850  {
1851  case 0:
1852  *attribute = gc->values.function;
1853  break;
1854  case 1:
1855  *attribute = gc->values.plane_mask;
1856  break;
1857  case 2:
1858  *attribute = gc->values.foreground;
1859  break;
1860  case 3:
1861  *attribute = gc->values.background;
1862  break;
1863  case 4:
1864  *attribute = gc->values.line_width;
1865  break;
1866  case 5:
1867  *attribute = gc->values.line_style;
1868  break;
1869  case 6:
1870  *attribute = gc->values.cap_style;
1871  break;
1872  case 7:
1873  *attribute = gc->values.join_style;
1874  break;
1875  case 8:
1876  *attribute = gc->values.fill_style;
1877  break;
1878  case 9:
1879  *attribute = gc->values.fill_rule;
1880  break;
1881  case 10:
1882  *attribute = gc->values.tile;
1883  break;
1884  case 11:
1885  *attribute = gc->values.stipple;
1886  break;
1887  case 12:
1888  *attribute = gc->values.ts_x_origin;
1889  break;
1890  case 13:
1891  *attribute = gc->values.ts_y_origin;
1892  break;
1893  case 14:
1894  *attribute = gc->values.font;
1895  break;
1896  case 15:
1897  *attribute = gc->values.subwindow_mode;
1898  break;
1899  case 16:
1900  *attribute = gc->values.graphics_exposures;
1901  break;
1902  case 17:
1903  *attribute = gc->values.clip_x_origin;
1904  break;
1905  case 18:
1906  *attribute = gc->values.clip_y_origin;
1907  break;
1908  case 19:
1909  *attribute = gc->values.clip_mask;
1910  break;
1911  case 20:
1912  *attribute = gc->values.dash_offset;
1913  break;
1914  case 21:
1915  *attribute =(unsigned char)(gc->values.dashes);
1916  break;
1917  case 22:
1918  *attribute = gc->values.arc_mode;
1919  break;
1920  case 23:
1921  *attribute = gc->rects;
1922  break;
1923  case 24:
1924  *attribute = gc->dashes;
1925  break;
1926  default:
1927  return FALSE;
1928  break;
1929  }
1930 #endif
1931  return TRUE;
1932 }
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
long GetIntAttr ( ptr_psi_term  psiTerm,
char *  attributeName 
)

GetIntAttr.

Parameters
psiTerm- ptr_psi_term psiTerm
attributeName- char *attributeName

Utilities return the value of the attribute attributeName on the psi-term psiTerm

Definition at line 333 of file xpred.c.

References wl_psi_term::attr_list, wl_node::data, deref_ptr, Errorline(), exit_life(), FEATCMP, find(), REAL, TRUE, and wl_psi_term::value_3.

334 {
335  ptr_node nodeAttr;
336  ptr_psi_term psiValue;
337 
338 
339  deref_ptr(psiTerm);
340  nodeAttr=find(FEATCMP,attributeName,psiTerm->attr_list);
341  if(!nodeAttr) {
342  Errorline("in GetIntAttr: didn't find %s on %P\n",
343  attributeName,
344  psiTerm);
345  exit_life(TRUE);
346  }
347 
348  psiValue=(ptr_psi_term)nodeAttr->data;
349  deref_ptr(psiValue);
350  if(psiValue->value_3)
351  return *(REAL *) psiValue->value_3;
352  else {
353  /* Errorline("in GetIntAttr: no value!\n"); */
354  return -34466; /* Real nasty hack for now RM: Apr 23 1993 */
355  }
356 }
#define FEATCMP
indicates to use featcmp for comparison (in trees.c)
Definition: def_const.h:979
void exit_life(long nl_flag)
exit_life
Definition: built_ins.c:2219
struct wl_psi_term * ptr_psi_term
quotedStackCopy
Definition: def_struct.h:62
GENERIC data
Definition: def_struct.h:201
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
Definition: def_const.h:132
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
#define deref_ptr(P)
Definition: def_macro.h:100
#define TRUE
Standard boolean.
Definition: def_const.h:268
GENERIC value_3
Definition: def_struct.h:186
ptr_node find(long comp, char *keystr, ptr_node tree)
find
Definition: trees.c:394
ptr_node attr_list
Definition: def_struct.h:187
ptr_psi_term GetPsiAttr ( ptr_psi_term  psiTerm,
char *  attributeName 
)

GetPsiAttr.

Parameters
psiTerm- ptr_psi_term psiTerm
attributeName- char *attributeName

Utilities return the psi-term of the attribute attributeName on the psi-term psiTerm

Definition at line 367 of file xpred.c.

References wl_psi_term::attr_list, wl_node::data, Errorline(), exit_life(), FEATCMP, find(), NULL, and TRUE.

368 {
369  ptr_node nodeAttr;
370  ptr_psi_term psiValue;
371 
372 
373  if((nodeAttr = find(FEATCMP,attributeName,psiTerm->attr_list)) == NULL)
374  {
375  Errorline("in GetPsiAttr: no attribute name on psi-term ?\n");
376  exit_life(TRUE);
377  }
378 
379  if((psiValue =(ptr_psi_term) nodeAttr->data) == NULL)
380  {
381  Errorline("in GetPsiAttr: no value on psi-term ?\n");
382  exit_life(TRUE);
383  }
384 
385  return psiValue;
386 }
#define FEATCMP
indicates to use featcmp for comparison (in trees.c)
Definition: def_const.h:979
void exit_life(long nl_flag)
exit_life
Definition: built_ins.c:2219
GENERIC data
Definition: def_struct.h:201
#define NULL
Definition: def_const.h:533
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
#define TRUE
Standard boolean.
Definition: def_const.h:268
ptr_node find(long comp, char *keystr, ptr_node tree)
find
Definition: trees.c:394
ptr_node attr_list
Definition: def_struct.h:187
static long GetScreenAttribute ( Display *  display,
long  screen,
long  attributeId,
long *  attribute 
)
static

GetScreenAttribute.

Parameters
display- Display *display
screen- long screen
attributeId- long attributeId
attribute- long *attribute

GetScreenAttribute

Definition at line 677 of file xpred.c.

References FALSE, and TRUE.

678 {
679  Screen *s;
680 
681 
682  s = ScreenOfDisplay(display,screen);
683  switch(attributeId)
684  {
685  case 0:
686  *attribute =(unsigned long) DisplayOfScreen(s);
687  break;
688  case 1:
689  *attribute =(unsigned long) RootWindowOfScreen(s);
690  break;
691  case 2:
692  *attribute =(unsigned long) WidthOfScreen(s);
693  break;
694  case 3:
695  *attribute =(unsigned long) HeightOfScreen(s);
696  break;
697  case 4:
698  *attribute =(unsigned long) WidthMMOfScreen(s);
699  break;
700  case 5:
701  *attribute =(unsigned long) HeightMMOfScreen(s);
702  break;
703  case 6:
704  *attribute =(unsigned long) DefaultDepthOfScreen(s);
705  break;
706  case 7:
707  *attribute =(unsigned long) DefaultVisualOfScreen(s);
708  break;
709  case 8:
710  *attribute =(unsigned long) DefaultGCOfScreen(s);
711  break;
712  case 9:
713  *attribute =(unsigned long) DefaultColormapOfScreen(s);
714  break;
715  case 10:
716  *attribute =(unsigned long) WhitePixelOfScreen(s);
717  break;
718  case 11:
719  *attribute =(unsigned long) BlackPixelOfScreen(s);
720  break;
721  case 12:
722  *attribute =(unsigned long) MaxCmapsOfScreen(s);
723  break;
724  case 13:
725  *attribute =(unsigned long) MinCmapsOfScreen(s);
726  break;
727  case 14:
728  *attribute =(unsigned long) DoesBackingStore(s);
729  break;
730  case 15:
731  *attribute =(unsigned long) DoesSaveUnders(s);
732  break;
733  case 16:
734  *attribute =(unsigned long) EventMaskOfScreen(s);
735  break;
736  default:
737  return FALSE;
738  break;
739  }
740 
741  return TRUE;
742 }
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
static long GetWindowAttribute ( Display *  display,
long  window,
long  attributeId,
long *  attribute 
)
static

GetWindowAttribute.

Parameters
display- Display *display
window- long window
attributeId- long attributeId
attribute- long *attribute

GetWindowAttribute

Definition at line 1129 of file xpred.c.

References FALSE, and TRUE.

1130 {
1131  XWindowAttributes windowAttributes;
1132 
1133 
1134  XGetWindowAttributes(display,window,&windowAttributes);
1135  switch(attributeId)
1136  {
1137  case 0:
1138  *attribute = windowAttributes.x;
1139  break;
1140  case 1:
1141  *attribute = windowAttributes.y;
1142  break;
1143  case 2:
1144  *attribute = windowAttributes.width;
1145  break;
1146  case 3:
1147  *attribute = windowAttributes.height;
1148  break;
1149  case 4:
1150  *attribute = windowAttributes.border_width;
1151  break;
1152  case 5:
1153  *attribute = windowAttributes.depth;
1154  break;
1155  case 6:
1156  *attribute = windowAttributes.root;
1157  break;
1158  case 7:
1159  *attribute =(unsigned long)windowAttributes.screen;
1160  break;
1161  case 8:
1162  *attribute =(unsigned long)windowAttributes.visual;
1163  break;
1164  case 9:
1165  *attribute = windowAttributes.class;
1166  break;
1167  case 10:
1168  *attribute = windowAttributes.all_event_masks;
1169  break;
1170  case 11:
1171  *attribute = windowAttributes.bit_gravity;
1172  break;
1173  case 12:
1174  *attribute = windowAttributes.win_gravity;
1175  break;
1176  case 13:
1177  *attribute = windowAttributes.backing_store;
1178  break;
1179  case 14:
1180  *attribute = windowAttributes.backing_planes;
1181  break;
1182  case 15:
1183  *attribute = windowAttributes.backing_pixel;
1184  break;
1185  case 16:
1186  *attribute = windowAttributes.override_redirect;
1187  break;
1188  case 17:
1189  *attribute = windowAttributes.save_under;
1190  break;
1191  case 18:
1192  *attribute = windowAttributes.your_event_mask;
1193  break;
1194  case 19:
1195  *attribute = windowAttributes.do_not_propagate_mask;
1196  break;
1197  case 20:
1198  *attribute = windowAttributes.colormap;
1199  break;
1200  case 21:
1201  *attribute = windowAttributes.map_installed;
1202  break;
1203  case 22:
1204  *attribute = windowAttributes.map_state;
1205  break;
1206  default:
1207  return FALSE;
1208  break;
1209  }
1210  return TRUE;
1211 }
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
ptr_goal GoalFromPsiTerm ( ptr_psi_term  psiTerm)

GoalFromPsiTerm.

Parameters
psiTerm- ptr_psi_term psiTerm

not used anymore, but interesting

Definition at line 3992 of file xpred.c.

References aim, Errorline(), FALSE, wl_residuation::goal, wl_residuation::next, NULL, and wl_psi_term::resid.

3993 {
3994  ptr_residuation resid;
3995  ptr_goal aim;
3996 
3997  if(psiTerm == NULL)
3998  {
3999  Errorline("X error in GoalFromPsiTerm: psiTerm is null\n");
4000  return FALSE;
4001  }
4002 
4003  if((resid = psiTerm->resid) == NULL)
4004  {
4005  Errorline("X error in GoalFromPsiTerm: psiTerm has no residuating functions\n");
4006  return FALSE;
4007  }
4008 
4009  if(resid->next != NULL)
4010  {
4011  Errorline("X error in GoalFromPsiTerm: psiTerm has more than one residuating function\n");
4012  return FALSE;
4013  }
4014 
4015  if((aim = resid->goal) == NULL)
4016  {
4017  Errorline("X error in GoalFromPsiTerm: psiTerm has no goal\n");
4018  return FALSE;
4019  }
4020 
4021  return aim;
4022 }
ptr_residuation resid
Definition: def_struct.h:189
ptr_goal goal
Definition: def_struct.h:172
ptr_residuation next
Definition: def_struct.h:173
#define NULL
Definition: def_const.h:533
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
#define FALSE
Standard boolean.
Definition: def_const.h:275
ptr_goal aim
Definition: def_glob.h:1024
ptr_psi_term list_car ( ptr_psi_term  lst)

list_car

Parameters
lstptr_psi_term lst

HAD BEEN ptr_psi_term list_car(ptr_psi_term(lst)) changed 2.30 DJD 12/22/2016

Definition at line 2963 of file xpred.c.

References alist, wl_psi_term::attr_list, deref_ptr, Errorline(), get_two_args(), and wl_psi_term::type.

2964 {
2965  ptr_psi_term car;
2966  ptr_psi_term cdr;
2967 
2968  deref_ptr(lst);
2969  if(lst->type==alist) {
2970  get_two_args(lst->attr_list,&car,&cdr);
2971  if(car) {
2972  deref_ptr(car);
2973  return car;
2974  }
2975  }
2976 
2977  Errorline("X event handling error in CAR(%P)\n",lst);
2978  return lst;
2979 }
ptr_definition alist
symbol in bi module
Definition: def_glob.h:319
void get_two_args(ptr_node t, ptr_psi_term *a, ptr_psi_term *b)
get_two_args
Definition: login.c:47
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
#define deref_ptr(P)
Definition: def_macro.h:100
ptr_definition type
Definition: def_struct.h:181
ptr_node attr_list
Definition: def_struct.h:187
ptr_psi_term list_cdr ( ptr_psi_term  lst)

list_cdr

Parameters
lstptr_psi_term lst

HAD BEEN ptr_psi_term list_cdr(ptr_psi_term(lst)) changed 2.30 DJD 12/22/2016

Definition at line 2936 of file xpred.c.

References alist, wl_psi_term::attr_list, deref_ptr, Errorline(), get_two_args(), and wl_psi_term::type.

2937 {
2938  ptr_psi_term car;
2939  ptr_psi_term cdr;
2940 
2941  deref_ptr(lst);
2942  if(lst->type==alist) {
2943  get_two_args(lst->attr_list,&car,&cdr);
2944  if(cdr) {
2945  deref_ptr(cdr);
2946  return cdr;
2947  }
2948  }
2949 
2950  Errorline("X event handling error in CDR(%P)\n",lst);
2951  return lst;
2952 }
ptr_definition alist
symbol in bi module
Definition: def_glob.h:319
void get_two_args(ptr_node t, ptr_psi_term *a, ptr_psi_term *b)
get_two_args
Definition: login.c:47
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
#define deref_ptr(P)
Definition: def_macro.h:100
ptr_definition type
Definition: def_struct.h:181
ptr_node attr_list
Definition: def_struct.h:187
long list_is_nil ( ptr_psi_term  lst)

Definition at line 2923 of file xpred.c.

References deref_ptr, nil, and wl_psi_term::type.

2924 {
2925  deref_ptr(lst);
2926  return lst->type==nil;
2927 }
#define deref_ptr(P)
Definition: def_macro.h:100
ptr_definition nil
symbol in bi module
Definition: def_glob.h:340
ptr_definition type
Definition: def_struct.h:181
ptr_psi_term list_last_cdr ( ptr_psi_term  lst)

list_last_cdr

Parameters
lst- ptr_psi_term lst

Definition at line 3019 of file xpred.c.

References list_cdr(), and list_is_nil().

3020 {
3021  while(!list_is_nil(lst))
3022  lst=list_cdr(lst);
3023  return lst;
3024 }
long list_is_nil(ptr_psi_term lst)
Definition: xpred.c:2923
ptr_psi_term list_cdr(ptr_psi_term lst)
list_cdr
Definition: xpred.c:2936
void list_remove_value ( ptr_psi_term  lst,
ptr_psi_term  value 
)

list_remove_value

Parameters
lst- ptr_psi_term lst
value- ptr_psi_term value

Definition at line 3103 of file xpred.c.

References wl_psi_term::coref, deref_ptr, FALSE, list_car(), list_cdr(), list_is_nil(), psi_term_ptr, push_ptr_value_global(), and TRUE.

3104 {
3105  ptr_psi_term car,cdr;
3106  long still_there=TRUE;
3107 
3108  deref_ptr(value);
3109  while(!list_is_nil(lst) && still_there) {
3110  car=list_car(lst);
3111  cdr=list_cdr(lst);
3112  if(car==value) {
3113  still_there=FALSE;
3115  lst->coref=cdr;
3116  }
3117  lst=cdr;
3118  }
3119 }
ptr_psi_term list_car(ptr_psi_term lst)
list_car
Definition: xpred.c:2963
void push_ptr_value_global(type_ptr t, GENERIC *p)
push_ptr_value_global
Definition: login.c:523
unsigned long * GENERIC
unsigned long *GENERIC
Definition: def_struct.h:35
#define deref_ptr(P)
Definition: def_macro.h:100
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
ptr_psi_term coref
Definition: def_struct.h:188
long list_is_nil(ptr_psi_term lst)
Definition: xpred.c:2923
ptr_psi_term list_cdr(ptr_psi_term lst)
list_cdr
Definition: xpred.c:2936
#define psi_term_ptr
values of type_ptr
Definition: def_const.h:383
void list_set_car ( ptr_psi_term  lst,
ptr_psi_term  value 
)

list_set_car

Parameters
lst- ptr_psi_term lst
value- ptr_psi_term value

Definition at line 2990 of file xpred.c.

References wl_psi_term::attr_list, deref_ptr, FEATCMP, one, and stack_insert().

2991 {
2992  deref_ptr(lst);
2993  stack_insert(FEATCMP,one,&(lst->attr_list),(GENERIC)value);
2994 }
#define FEATCMP
indicates to use featcmp for comparison (in trees.c)
Definition: def_const.h:979
unsigned long * GENERIC
unsigned long *GENERIC
Definition: def_struct.h:35
ptr_node stack_insert(long comp, char *keystr, ptr_node *tree, GENERIC info)
stack_insert
Definition: trees.c:337
#define deref_ptr(P)
Definition: def_macro.h:100
char * one
Definition: def_glob.h:891
ptr_node attr_list
Definition: def_struct.h:187
void list_set_cdr ( ptr_psi_term  lst,
ptr_psi_term  value 
)

list_set_cdr

Parameters
lst- ptr_psi_term lst
value- ptr_psi_term value

Definition at line 3005 of file xpred.c.

References wl_psi_term::attr_list, deref_ptr, FEATCMP, stack_insert(), and two.

3006 {
3007  deref_ptr(lst);
3008  stack_insert(FEATCMP,two,&(lst->attr_list),(GENERIC)value);
3009 }
#define FEATCMP
indicates to use featcmp for comparison (in trees.c)
Definition: def_const.h:979
char * two
Definition: def_glob.h:892
unsigned long * GENERIC
unsigned long *GENERIC
Definition: def_struct.h:35
ptr_node stack_insert(long comp, char *keystr, ptr_node *tree, GENERIC info)
stack_insert
Definition: trees.c:337
#define deref_ptr(P)
Definition: def_macro.h:100
ptr_node attr_list
Definition: def_struct.h:187
long map_funct_over_cars ( ptr_psi_term  lst,
long(*)()  proc,
long *  closure 
)

map_funct_over_cars

Parameters
lst- ptr_psi_term lst
proc- long(*proc)()
closure- long *closure

Definition at line 3078 of file xpred.c.

References list_car(), list_cdr(), list_is_nil(), and TRUE.

3079 {
3080  ptr_psi_term cdr;
3081  int notInterrupted = TRUE;
3082 
3083  while(notInterrupted && !list_is_nil(lst)) {
3084  /* save the next because the current could be removed
3085  (eg: xcFlushEvents) */
3086 
3087  cdr=list_cdr(lst);
3088  notInterrupted=(*proc)(list_car(lst),closure);
3089  lst=cdr;
3090  }
3091 
3092  return notInterrupted;
3093 }
ptr_psi_term list_car(ptr_psi_term lst)
list_car
Definition: xpred.c:2963
#define TRUE
Standard boolean.
Definition: def_const.h:268
long list_is_nil(ptr_psi_term lst)
Definition: xpred.c:2923
ptr_psi_term list_cdr(ptr_psi_term lst)
list_cdr
Definition: xpred.c:2936
long map_funct_over_list ( ptr_psi_term  lst,
long(*)()  proc,
long *  closure 
)

map_funct_over_list

Parameters
lst- ptr_psi_term lst
proc- long(*proc)()
closure- long *closure

Definition at line 3056 of file xpred.c.

References list_cdr(), list_is_nil(), and TRUE.

3057 {
3058  long notInterrupted=TRUE;
3059 
3060  while(notInterrupted && !list_is_nil(lst)) {
3061  notInterrupted =(*proc)(lst,closure);
3062  lst=list_cdr(lst);
3063  }
3064 
3065  return notInterrupted;
3066 }
#define TRUE
Standard boolean.
Definition: def_const.h:268
long list_is_nil(ptr_psi_term lst)
Definition: xpred.c:2923
ptr_psi_term list_cdr(ptr_psi_term lst)
list_cdr
Definition: xpred.c:2936
static long mask_match_type ( long  mask,
long  type 
)
static

mask_match_type

Parameters
mask- long mask
type- long type

Static returns TRUE if the mask matches the type

Definition at line 3628 of file xpred.c.

References FALSE, TRUE, and xevent_mask.

3629 {
3630  long em;
3631 
3632  /* printf("mask=%d,type=%d=%s\n",mask,type,xevent_name[type]); */
3633 
3634  em=xevent_mask[type];
3635  if(!em ||(em & mask))
3636  return TRUE;
3637 
3638  /* printf("FALSE\n"); printf("event mask=%d\n",em); */
3639 
3640  return FALSE;
3641 }
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
static long xevent_mask[]
Definition: xpred.c:57
static ptr_psi_term NewPsi ( ptr_definition  t,
char *  f,
long  v 
)
static

ptr_psi_term NewPsi

Parameters
t- ptr_definition t
f- char *f
v- long v

Static build a psi-term of type t with a feature f of value v

Definition at line 314 of file xpred.c.

References bk_stack_add_int_attr(), stack_psi_term(), and wl_psi_term::type.

315 {
316  ptr_psi_term p;
317 
318  p = stack_psi_term(4);
319  p->type = t;
320  bk_stack_add_int_attr(p,f,v);
321  return p;
322 }
ptr_psi_term stack_psi_term(long stat)
stack_psi_term
Definition: lefun.c:21
void bk_stack_add_int_attr(ptr_psi_term t, char *attrname, long value)
bk_stack_add_int_attr
Definition: xpred.c:206
ptr_definition type
Definition: def_struct.h:181
static void ResizePixmap ( ptr_psi_term  psi_window,
Display *  display,
Window  window,
unsigned long  width,
unsigned long  height 
)
static

ResizePixmap.

Parameters
psi_window- ptr_psi_term psi_window
display- Display *display
window- Window window
width- unsigned long width
height- unsigned long height

Static resize the pixmap of the window

Definition at line 400 of file xpred.c.

References bk_change_psi_attr(), bk_stack_add_int_attr(), GetIntAttr(), GetPsiAttr(), NewPsi(), and NULL.

401 {
402  Pixmap pixmap;
403  GC pixmapGC;
404  ptr_psi_term psiPixmap,psiPixmapGC;
405  XGCValues gcvalues;
406  XWindowAttributes attr;
407  ptr_psi_term psi_gc;
408 
409 
410  /* free the old pixmap */
411  psiPixmap = GetPsiAttr(psi_window,"pixmap");
412  psiPixmapGC=NULL;
413 
414  if((pixmap = GetIntAttr(psiPixmap,"id")) != 0)
415  {
416  /* change the pixmap */
417  XFreePixmap(display,pixmap);
418  /* change the pixmap'gc too,because the gc is created on the pixmap ! */
419 
420  psiPixmapGC = GetPsiAttr(psiPixmap,"graphic_context");
421 
422  /* RM: Jun 24 1993 */
423  pixmapGC=(GC)GetIntAttr(psiPixmapGC,"id");
424  if(pixmapGC)
425  XFreeGC(display,pixmapGC);
426 
427  bk_stack_add_int_attr(psiPixmap,"id",(long)NULL);
428  bk_stack_add_int_attr(psiPixmapGC,"id",(long)NULL);
429  }
430 
431  /* init a new pixmap on the window */
432  XGetWindowAttributes(display,window,&attr);
433  if((pixmap = XCreatePixmap(display,window,
434  attr.width+1,attr.height+1,
435  attr.depth)) != 0)
436  {
437  bk_stack_add_int_attr(psiPixmap,"id",(long)pixmap);
438  gcvalues.cap_style = CapRound;
439  gcvalues.join_style = JoinRound;
440  pixmapGC = XCreateGC(display,pixmap,
441  GCJoinStyle|GCCapStyle,&gcvalues);
442 
443  /* RM: Jun 24 1993 */
444  if(psiPixmapGC)
445  bk_stack_add_int_attr(psiPixmapGC,"id",(long)pixmapGC); // add cast DJD
446  else
447  psiPixmapGC=NewPsi(xgc,"id",(long)pixmapGC); // add cast DJD
448  bk_change_psi_attr(psiPixmap,"graphic_context",psiPixmapGC);
449  }
450 }
ptr_definition xgc
Definition: xpred.c:45
#define NULL
Definition: def_const.h:533
ptr_psi_term GetPsiAttr(ptr_psi_term psiTerm, char *attributeName)
GetPsiAttr.
Definition: xpred.c:367
void bk_change_psi_attr(ptr_psi_term t, char *attrname, ptr_psi_term value)
bk_change_psi_attr
Definition: xpred.c:240
void bk_stack_add_int_attr(ptr_psi_term t, char *attrname, long value)
bk_stack_add_int_attr
Definition: xpred.c:206
static ptr_psi_term NewPsi(ptr_definition t, char *f, long v)
ptr_psi_term NewPsi
Definition: xpred.c:314
long GetIntAttr(ptr_psi_term psiTerm, char *attributeName)
GetIntAttr.
Definition: xpred.c:333
static long SetGCAttribute ( Display *  display,
GC  gc,
long  attributeId,
long  attribute 
)
static

SetGCAttribute.

Parameters
display- Display *display
gc- GC gc
attributeId- long attributeId
attribute- long attribute

SETGCATTRIBUTE

Definition at line 1978 of file xpred.c.

References FALSE, and TRUE.

1979 {
1980  XGCValues attributes;
1981  unsigned long attributesMask = 0;
1982 
1983  switch(attributeId)
1984  {
1985  case 0:
1986  attributes.function = attribute;
1987  attributesMask |= GCFunction;
1988  break;
1989  case 1:
1990  attributes.plane_mask = attribute;
1991  attributesMask |= GCPlaneMask;
1992  break;
1993  case 2:
1994  attributes.foreground = attribute;
1995  attributesMask |= GCForeground;
1996  break;
1997  case 3:
1998  attributes.background = attribute;
1999  attributesMask |= GCBackground;
2000  break;
2001  case 4:
2002  attributes.line_width = attribute;
2003  attributesMask |= GCLineWidth;
2004  break;
2005  case 5:
2006  attributes.line_style = attribute;
2007  attributesMask |= GCLineStyle;
2008  break;
2009  case 6:
2010  attributes.cap_style = attribute;
2011  attributesMask |= GCCapStyle;
2012  break;
2013  case 7:
2014  attributes.join_style = attribute;
2015  attributesMask |= GCJoinStyle;
2016  break;
2017  case 8:
2018  attributes.fill_style = attribute;
2019  attributesMask |= GCFillStyle;
2020  break;
2021  case 9:
2022  attributes.fill_rule = attribute;
2023  attributesMask |= GCFillRule;
2024  break;
2025  case 10:
2026  attributes.tile = attribute;
2027  attributesMask |= GCTile;
2028  break;
2029  case 11:
2030  attributes.stipple = attribute;
2031  attributesMask |= GCStipple;
2032  break;
2033  case 12:
2034  attributes.ts_x_origin = attribute;
2035  attributesMask |= GCTileStipXOrigin;
2036  break;
2037  case 13:
2038  attributes.ts_y_origin = attribute;
2039  attributesMask |= GCTileStipYOrigin;
2040  break;
2041  case 14:
2042  attributes.font = attribute;
2043  attributesMask |= GCFont;
2044  break;
2045  case 15:
2046  attributes.subwindow_mode = attribute;
2047  attributesMask |= GCSubwindowMode;
2048  break;
2049  case 16:
2050  attributes.graphics_exposures = attribute;
2051  attributesMask |= GCGraphicsExposures;
2052  break;
2053  case 17:
2054  attributes.clip_x_origin = attribute;
2055  attributesMask |= GCClipXOrigin;
2056  break;
2057  case 18:
2058  attributes.clip_y_origin = attribute;
2059  attributesMask |= GCClipYOrigin;
2060  break;
2061  case 19:
2062  attributes.clip_mask = attribute;
2063  attributesMask |= GCClipMask;
2064  break;
2065  case 20:
2066  attributes.dash_offset = attribute;
2067  attributesMask |= GCDashOffset;
2068  break;
2069  case 21:
2070  attributes.dashes =(char)(0xFF & attribute);
2071  attributesMask |= GCDashList;
2072  break;
2073  case 22:
2074  attributes.arc_mode = attribute;
2075  attributesMask |= GCArcMode;
2076  break;
2077  default:
2078  return FALSE;
2079  break;
2080  }
2081 
2082  XChangeGC(display,gc,attributesMask,&attributes);
2083  return TRUE;
2084 }
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
static long SetWindowAttribute ( ptr_psi_term  psi_window,
Display *  display,
Drawable  window,
unsigned long  attributeId,
unsigned long  attribute 
)
static

SetWindowAttribute.

Parameters
psi_window- ptr_psi_term psi_window
display- Display *display
window- Drawable window
attributeId- unsigned long attributeId
attribute- unsigned long attribute

SetWindowAttribute

Definition at line 1318 of file xpred.c.

References FALSE, ResizePixmap(), and TRUE.

1319 {
1320  XSetWindowAttributes attributes;
1321  XWindowChanges changes;
1322  unsigned long attributesMask = 0;
1323  unsigned long changesMask = 0;
1324  long backgroundChange = FALSE;
1325  long sizeChange = FALSE;
1326  unsigned int width,height;
1327  int x,y;
1328  unsigned int bw,d;
1329  Window r;
1330 
1331  switch(attributeId)
1332  {
1333  case 0:
1334  changes.x = attribute;
1335  changesMask |= CWX;
1336  break;
1337  case 1:
1338  changes.y = attribute;
1339  changesMask |= CWY;
1340  break;
1341  case 2:
1342  changes.width = attribute;
1343  changesMask |= CWWidth;
1344  XGetGeometry(display,window,&r,&x,&y,&width,&height,&bw,&d);
1345  width = attribute;
1346  sizeChange = TRUE;
1347  break;
1348  case 3:
1349  changes.height = attribute;
1350  changesMask |= CWHeight;
1351  XGetGeometry(display,window,&r,&x,&y,&width,&height,&bw,&d);
1352  height = attribute;
1353  sizeChange = TRUE;
1354  break;
1355  case 4:
1356  changes.border_width = attribute;
1357  changesMask |= CWBorderWidth;
1358  break;
1359  case 11:
1360  attributes.bit_gravity = attribute;
1361  attributesMask |= CWBitGravity;
1362  break;
1363  case 12:
1364  attributes.win_gravity = attribute;
1365  attributesMask |= CWWinGravity;
1366  break;
1367  case 13:
1368  attributes.backing_store = attribute;
1369  attributesMask |= CWBackingStore;
1370  break;
1371  case 14:
1372  attributes.backing_planes = attribute;
1373  attributesMask |= CWBackingPlanes;
1374  break;
1375  case 15:
1376  attributes.backing_pixel = attribute;
1377  attributesMask |= CWBackingPixel;
1378  break;
1379  case 16:
1380  attributes.override_redirect = attribute;
1381  attributesMask |= CWOverrideRedirect;
1382  break;
1383  case 17:
1384  attributes.save_under = attribute;
1385  attributesMask |= CWSaveUnder;
1386  break;
1387  case 18:
1388  attributes.event_mask = attribute;
1389  attributesMask |= CWEventMask;
1390  break;
1391  case 19:
1392  attributes.do_not_propagate_mask = attribute;
1393  attributesMask |= CWDontPropagate;
1394  break;
1395  case 20:
1396  attributes.colormap = attribute;
1397  attributesMask |= CWColormap;
1398  break;
1399  case 23:
1400  changes.sibling = attribute;
1401  changesMask |= CWSibling;
1402  break;
1403  case 24:
1404  changes.stack_mode = attribute;
1405  changesMask |= CWStackMode;
1406  break;
1407  case 25:
1408  attributes.background_pixmap = attribute;
1409  attributesMask |= CWBackPixmap;
1410  break;
1411  case 26:
1412  attributes.background_pixel = attribute;
1413  attributesMask |= CWBackPixel;
1414  backgroundChange = TRUE;
1415 
1416  /* change the backing_pixel in order to fill the pixmap with */
1417  attributes.backing_pixel = attribute;
1418  attributesMask |= CWBackingPixel;
1419  break;
1420  case 27:
1421  attributes.border_pixmap = attribute;
1422  attributesMask |= CWBorderPixmap;
1423  break;
1424  case 28:
1425  attributes.border_pixel = attribute;
1426  attributesMask |= CWBorderPixel;
1427  break;
1428  case 29:
1429  attributes.cursor = attribute;
1430  attributesMask |= CWCursor;
1431  break;
1432  default:
1433  return FALSE;
1434  break;
1435  }
1436 
1437  if(changesMask)
1438  XConfigureWindow(display,window,changesMask,&changes);
1439 
1440  if(attributesMask)
1441  XChangeWindowAttributes(display,window,attributesMask,&attributes);
1442 
1443  if(backgroundChange)
1444  XClearArea(display,window,0,0,0,0,True);
1445 
1446  if(sizeChange)
1447  ResizePixmap(psi_window,display,window,width,height);
1448 
1449  return TRUE;
1450 }
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
static void ResizePixmap(ptr_psi_term psi_window, Display *display, Window window, unsigned long width, unsigned long height)
ResizePixmap.
Definition: xpred.c:400
long unify_int_result ( ptr_psi_term  t,
long  v 
)

unify_int_result

Parameters
t- ptr_psi_term t
v- long v

Utility unify psi_term T to the integer value V could be in builtins.c

Definition at line 271 of file xpred.c.

References def_ptr, deref_ptr, FALSE, heap_alloc(), i_check_out(), int_ptr, integer, matches(), push_ptr_value(), REAL, release_resid(), wl_psi_term::resid, wl_psi_term::status, TRUE, wl_psi_term::type, and wl_psi_term::value_3.

272 {
273  long smaller;
274  long success=TRUE;
275 
276 
277  deref_ptr(t);
279  t->value_3 = heap_alloc(sizeof(REAL));
280  *(REAL *) t->value_3 = v;
281 
282  matches(t->type,integer,&smaller);
283 
284  if(!smaller)
285  {
287  t->type = integer;
288  t->status = 0;
289  }
290  else
291  success = FALSE;
292 
293  if(success)
294  {
295  i_check_out(t);
296  if(t->resid)
297  release_resid(t);
298  }
299 
300  return success;
301 }
ptr_residuation resid
Definition: def_struct.h:189
void push_ptr_value(type_ptr t, GENERIC *p)
push_ptr_value
Definition: login.c:383
ptr_definition integer
symbol in bi module
Definition: def_glob.h:312
#define def_ptr
values of type_ptr
Definition: def_const.h:404
long matches(ptr_definition t1, ptr_definition t2, long *smaller)
matches
Definition: types.c:1666
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
Definition: def_const.h:132
void release_resid(ptr_psi_term t)
release_resid
Definition: lefun.c:445
unsigned long * GENERIC
unsigned long *GENERIC
Definition: def_struct.h:35
#define deref_ptr(P)
Definition: def_macro.h:100
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
GENERIC value_3
Definition: def_struct.h:186
ptr_definition type
Definition: def_struct.h:181
long i_check_out(ptr_psi_term t)
i_check_out
Definition: lefun.c:1033
GENERIC heap_alloc(long s)
heap_alloc
Definition: memory.c:1616
#define int_ptr
values of type_ptr
Definition: def_const.h:397
static long WaitNextEvent ( long *  ptreventflag)
static

WaitNextEvent.

Parameters
ptreventflag- long *ptreventflag

not a built-in called by what_next_aim in login.c

Definition at line 3496 of file xpred.c.

References Errorline(), exit_life(), FALSE, input_stream, interrupt(), start_of_line, stdin_fileno, TRUE, and x_exist_event().

3497 {
3498  long nfds;
3499  fd_set readfd,writefd,exceptfd;
3500  struct timeval timeout;
3501  long charflag = FALSE,nbchar;
3502  char c = 0;
3503 
3504  *ptreventflag = FALSE;
3505 
3506  do
3507  {
3508  FD_ZERO(&readfd);
3509  FD_SET(stdin_fileno, &readfd);
3510  FD_ZERO(&writefd);
3511  FD_ZERO(&exceptfd);
3512  timeout.tv_sec = 0;
3513  timeout.tv_usec = 100000;
3514 
3515  nfds = select(32,&readfd,&writefd,&exceptfd,&timeout);
3516  if(nfds == -1)
3517  {
3518 #if 0
3519  /* not an error,but a signal has been occured */
3520  /* handle_interrupt(); does not work */
3521  exit();
3522 #endif
3523  if(errno != EINTR)
3524  {
3525  Errorline("in select: interruption error.\n");
3526  exit_life(TRUE);
3527  }
3528  else
3529  interrupt();
3530  }
3531 
3532  else
3533  if(nfds == 0)
3534  {
3535 #ifdef X11
3536  if(x_exist_event())
3537  {
3538  *ptreventflag = TRUE;
3539  start_of_line = TRUE;
3540  }
3541 #endif
3542  }
3543  else
3544  {
3545  if(FD_ISSET(stdin_fileno, &readfd) != 0)
3546  {
3547 #if 0
3548  if((nbchar = read(stdin_fileno,&c,1)) == -1)
3549  {
3550  Errorline("in select: keyboard error.\n");
3551  exit_life(TRUE);
3552  }
3553 
3554  /* see manpage of read */
3555  if(nbchar == 0)
3556  c = EOF;
3557 #endif
3558  c = fgetc(input_stream);
3559  charflag = TRUE;
3560  }
3561  else
3562  {
3563  Errorline("select error.\n");
3564  exit_life(TRUE);
3565  }
3566  }
3567  } while(!(charflag || *ptreventflag));
3568 
3569  return c;
3570 }
long x_exist_event()
x_exist_event
Definition: xpred.c:3787
void interrupt()
INTERRUPT()
Definition: interrupt.c:21
void exit_life(long nl_flag)
exit_life
Definition: built_ins.c:2219
#define stdin_fileno
Definition: xpred.c:24
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
FILE * input_stream
Definition: def_glob.h:1014
long start_of_line
???
Definition: def_glob.h:846
static void x_build_existing_event ( XEvent *  event,
ptr_psi_term  beginSpan,
ptr_psi_term  endSpan,
long  eventType 
)
static

x_build_existing_event

Parameters
event- XEvent *event
beginSpan- ptr_psi_term beginSpan
endSpan- ptr_psi_term endSpan
eventType- long eventType

Static builds xevent_existing

Definition at line 3677 of file xpred.c.

References bk_change_psi_attr(), list_remove_value(), psi_term_ptr, push_ptr_value_global(), warningline(), x_what_psi_event(), and xcEventToPsiTerm().

3678 {
3679  ptr_psi_term psiEvent;
3680 
3681  /* printf("building event: type=%s event=%s\n",
3682  xevent_name[type],xevent_name[event->type]); */
3683 
3684  /* get the event from the list */
3685  psiEvent = x_what_psi_event(beginSpan,endSpan,eventType);
3686 
3687  /* put the event on the waiting event */
3688  bk_change_psi_attr(psiEvent,"event",xcEventToPsiTerm(event));
3689 
3690  /* set the global */
3691  if(xevent_existing)
3692  warningline("xevent_existing is non-null in x_build_existing_event");
3694  xevent_existing = psiEvent;
3695 
3696  /* remove the event from the list */
3697  /* 9.10 */
3698  /* if(list_car(xevent_list) == psiEvent) */
3699  /* push_ptr_value_global(psi_term_ptr,(GENERIC *)&xevent_list); */
3700  /* xevent_list = list_remove_value(xevent_list,psiEvent); */
3701  list_remove_value(xevent_list,psiEvent); /* RM: Dec 15 1992 */
3702 }
static ptr_psi_term x_what_psi_event(ptr_psi_term beginSpan, ptr_psi_term endSpan, long eventType)
x_what_psi_event
Definition: xpred.c:3653
void push_ptr_value_global(type_ptr t, GENERIC *p)
push_ptr_value_global
Definition: login.c:523
ptr_psi_term xevent_list
Definition: xpred.c:43
unsigned long * GENERIC
unsigned long *GENERIC
Definition: def_struct.h:35
static ptr_psi_term xcEventToPsiTerm(XEvent *event)
xcEventToPsiTerm
Definition: xpred.c:2802
void bk_change_psi_attr(ptr_psi_term t, char *attrname, ptr_psi_term value)
bk_change_psi_attr
Definition: xpred.c:240
ptr_psi_term xevent_existing
Definition: xpred.c:42
void warningline(char *format,...)
warningline
Definition: error.c:371
void list_remove_value(ptr_psi_term lst, ptr_psi_term value)
list_remove_value
Definition: xpred.c:3103
#define psi_term_ptr
values of type_ptr
Definition: def_const.h:383
void x_destroy_window ( Display *  display,
Window  window 
)

x_destroy_window

Parameters
display- Display *display
window- Window window

used when backtracking a created window in order to destroy the window

Definition at line 3852 of file xpred.c.

3853 {
3854  /* we need the psi-term window(not the value) to get the display list,the pixmap ...
3855  jch - Fri Aug 7 15:29:14 MET DST 1992
3856 
3857  FreeWindow(display,window);
3858  */
3859  XDestroyWindow(display,window);
3860  XSync(display,0);
3861 }
long x_exist_event ( )

x_exist_event

not a built-in used by main_prove() and what_next()

Definition at line 3787 of file xpred.c.

References wl_EventClosure::beginSpan, wl_EventClosure::display, FALSE, list_is_nil(), list_last_cdr(), map_funct_over_list(), wl_EventClosure::mask, NULL, TRUE, wl_psi_term::type, wl_EventClosure::window, x_build_existing_event(), and x_next_event_span().

3788 {
3789  XEvent event,exposeEvent;
3790  ptr_psi_term eventElt;
3791  EventClosure eventClosure;
3792 
3793 
3794  /*Infoline("xevent_list=%P\n",xevent_list); */
3795 
3796  if(xevent_existing)
3797  return TRUE;
3798 
3799  if(list_is_nil(xevent_list)) {
3800  /* printf("nil event list\n"); */
3801  return FALSE;
3802  }
3803 
3804 
3805  /* traverse the list of waiting events */
3806  eventClosure.display = NULL;
3807  if(!map_funct_over_list(xevent_list,x_next_event_span,(long *)&eventClosure))
3808  return TRUE;
3809 
3810  /* printf("display=%d,window=%d,mask=%d\n",
3811  eventClosure.display,eventClosure.window,eventClosure.mask); */
3812 
3813 
3814 
3815  /* check the last span */
3816  if(XCheckWindowEvent(eventClosure.display,
3817  eventClosure.window,
3818  eventClosure.mask,
3819  &event)) {
3820 
3821  /* printf("*** here event %d ***\n",event.xany.type); */
3822 
3823  if(event.xany.window==eventClosure.window) {
3824  if(event.type == Expose)
3825  while(XCheckWindowEvent(eventClosure.display,
3826  eventClosure.window,
3827  ExposureMask,
3828  &exposeEvent))
3829  ; /* that is continue until no expose event */
3830 
3831  /* build a psi-term containing the event */
3832  x_build_existing_event(&event,
3833  eventClosure.beginSpan,
3834  list_last_cdr(xevent_list),/* RM: Dec 15 1992*/
3835  event.type);
3836  return TRUE;
3837  }
3838  }
3839  else
3840  return FALSE;
3841 }
Display * display
Definition: xpred.c:32
ptr_psi_term list_last_cdr(ptr_psi_term lst)
list_last_cdr
Definition: xpred.c:3019
static void x_build_existing_event(XEvent *event, ptr_psi_term beginSpan, ptr_psi_term endSpan, long eventType)
x_build_existing_event
Definition: xpred.c:3677
ptr_psi_term xevent_list
Definition: xpred.c:43
#define NULL
Definition: def_const.h:533
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
long map_funct_over_list(ptr_psi_term lst, long(*proc)(), long *closure)
map_funct_over_list
Definition: xpred.c:3056
static long x_next_event_span(ptr_psi_term eventElt, EventClosure *eventClosure)
x_next_event_span
Definition: xpred.c:3713
ptr_psi_term beginSpan
Definition: xpred.c:35
long list_is_nil(ptr_psi_term lst)
Definition: xpred.c:2923
long mask
Definition: xpred.c:34
ptr_psi_term xevent_existing
Definition: xpred.c:42
ptr_definition type
Definition: def_struct.h:181
Window window
Definition: xpred.c:33
static long x_flush_event ( ptr_psi_term  eventElt,
EventClosure closure 
)
static

x_flush_event

Parameters
eventElt- ptr_psi_term eventElt
closure- EventClosure *closure

Static remove the event from the queue if matching

Definition at line 3215 of file xpred.c.

References wl_EventClosure::display, GetIntAttr(), list_car(), list_remove_value(), wl_EventClosure::mask, TRUE, and wl_EventClosure::window.

3216 {
3217  ptr_psi_term psiEvent;
3218 
3219  psiEvent = list_car(eventElt);
3220  if ((Display *)GetIntAttr(psiEvent,"display") == closure->display
3221  && (Window)GetIntAttr(psiEvent,"window") ==closure->window
3222  && (GetIntAttr(psiEvent,"mask") & closure->mask) != 0)
3223  {
3224  /* 9.10 */
3225  /* if(xevent_list == eventElt) */
3226  /* push_ptr_value_global(psi_term_ptr,(GENERIC *)&xevent_list); */
3227  /* xevent_list = list_remove_value(xevent_list,psiEvent); */
3228  list_remove_value(xevent_list,psiEvent); /* RM: Dec 15 1992 */
3229  }
3230 
3231  return TRUE;
3232 }
Display * display
Definition: xpred.c:32
ptr_psi_term list_car(ptr_psi_term lst)
list_car
Definition: xpred.c:2963
ptr_psi_term xevent_list
Definition: xpred.c:43
#define TRUE
Standard boolean.
Definition: def_const.h:268
long mask
Definition: xpred.c:34
void list_remove_value(ptr_psi_term lst, ptr_psi_term value)
list_remove_value
Definition: xpred.c:3103
Window window
Definition: xpred.c:33
long GetIntAttr(ptr_psi_term psiTerm, char *attributeName)
GetIntAttr.
Definition: xpred.c:333
static int x_handle_error ( Display *  display,
XErrorEvent *  x_error 
)
static

x_handle_error

Parameters
display- Display *display
x_error- XErrorEvent *x_error

Definition at line 170 of file xpred.c.

References Errorline(), exit_life(), and TRUE.

171 {
172  char msg[128];
173  XGetErrorText(display,x_error->error_code,msg,128);
174  Errorline("X error message: %s.\n",msg);
175  /* don't use abort_life(TRUE) because it tries to destroy windows ...
176  and loops because the window is yet in the stack !!
177  jch - Fri Aug 7 17:58:27 MET DST 1992
178  */
179  exit_life(TRUE);
180 }
void exit_life(long nl_flag)
exit_life
Definition: built_ins.c:2219
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
#define TRUE
Standard boolean.
Definition: def_const.h:268
static int x_handle_fatal_error ( Display *  display)
static

x_handle_fatal_error

Parameters
display- Display *display

Definition at line 188 of file xpred.c.

References Errorline(), exit_life(), and TRUE.

189 {
190  Errorline("fatal X Error.\n");
191  exit_life(TRUE);
192 }
void exit_life(long nl_flag)
exit_life
Definition: built_ins.c:2219
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
#define TRUE
Standard boolean.
Definition: def_const.h:268
void x_hide_subwindow ( Display *  display,
long  window 
)

x_hide_subwindow

Parameters
display- Display *display
window- long window

used when backtracking a xcMapWindow in order to hide the window

Definition at line 3915 of file xpred.c.

3916 {
3917  XUnmapSubwindows(display,window);
3918  XSync(display,0);
3919 }
void x_hide_window ( Display *  display,
long  window 
)

x_hide_window

Parameters
display- Display *display
window- long window

used when backtracking a xcMapWindow in order to hide the window

Definition at line 3885 of file xpred.c.

3886 {
3887  XUnmapWindow(display,window);
3888  XSync(display,0);
3889 }
static long x_next_event_span ( ptr_psi_term  eventElt,
EventClosure eventClosure 
)
static

x_next_event_span

Parameters
eventElt- ptr_psi_term eventElt
eventClosure- EventClosure *eventClosure

Static get the next span of waiting events

Definition at line 3713 of file xpred.c.

References wl_EventClosure::beginSpan, wl_EventClosure::display, FALSE, GetIntAttr(), list_car(), wl_EventClosure::mask, NULL, TRUE, wl_psi_term::type, wl_EventClosure::window, and x_build_existing_event().

3714 {
3715  ptr_psi_term psiEvent;
3716  Display *display;
3717  Window window;
3718  long mask;
3719  XEvent event;
3720 
3721 
3722  psiEvent = list_car(eventElt);
3723  display =(Display *)GetIntAttr(psiEvent,"display");
3724  window =(Window)GetIntAttr(psiEvent,"window");
3725  mask = GetIntAttr(psiEvent,"mask");
3726 
3727  if(eventClosure->display == NULL) {
3728  /* new span */
3729  eventClosure->display = display;
3730  eventClosure->window = window;
3731  eventClosure->mask = mask;
3732  eventClosure->beginSpan = eventElt;
3733  return TRUE;
3734  }
3735  else
3736  if(eventClosure->display == display && eventClosure->window == window) {
3737  /* same span */
3738  eventClosure->mask |= mask;
3739  return TRUE;
3740  }
3741  else {
3742  /* a next span begins,check the current span */
3743  Repeat:
3744  if(XCheckWindowEvent(eventClosure->display,eventClosure->window,
3745  eventClosure->mask,&event)
3746  /* && event.xany.window == eventClosure->window */)
3747  {
3748  /* 9.10 */
3749  /* printf("Event type = %ld.\n",event.type); */
3750 
3751 
3752  if((event.type==Expose || event.type==GraphicsExpose)
3753  && event.xexpose.count!=0) {
3754  /* printf("Expose count = %ld.\n", event.xexpose.count); */
3755  goto Repeat;
3756  }
3757 
3758  /* build a psi-term containing the event */
3759 
3760  /* printf("*** event %d ***\n",event.type); */
3761 
3762  x_build_existing_event(&event,
3763  eventClosure->beginSpan,
3764  eventElt,event.type);
3765 
3766  return FALSE; /* stop ! we have an existing event !! */
3767  }
3768  else
3769  {
3770  /* init the new span */
3771  eventClosure->display = display;
3772  eventClosure->window = window;
3773  eventClosure->mask = mask;
3774  eventClosure->beginSpan = eventElt;
3775  return TRUE;
3776  }
3777  }
3778 }
Display * display
Definition: xpred.c:32
ptr_psi_term list_car(ptr_psi_term lst)
list_car
Definition: xpred.c:2963
static void x_build_existing_event(XEvent *event, ptr_psi_term beginSpan, ptr_psi_term endSpan, long eventType)
x_build_existing_event
Definition: xpred.c:3677
#define NULL
Definition: def_const.h:533
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
ptr_psi_term beginSpan
Definition: xpred.c:35
long mask
Definition: xpred.c:34
ptr_definition type
Definition: def_struct.h:181
Window window
Definition: xpred.c:33
long GetIntAttr(ptr_psi_term psiTerm, char *attributeName)
GetIntAttr.
Definition: xpred.c:333
long x_read_stdin_or_event ( long *  ptreventflag)

x_read_stdin_or_event

Parameters
ptreventflag- long *ptreventflag

Definition at line 3578 of file xpred.c.

References EOLN, FALSE, infoline(), input_stream, line_count, NOTQUIET, NULL, old_saved_char, output_stream, prompt, saved_char, start_of_line, TRUE, verbose, and WaitNextEvent().

3579 {
3580  long c = 0;
3581 
3582  *ptreventflag = FALSE;
3583 
3584  if(c = saved_char) /* not an error ;-) */
3585  {
3587  old_saved_char=0;
3588  }
3589  else
3590  {
3591  if(input_stream == NULL || feof(input_stream))
3592  c = EOF;
3593  else
3594  {
3595  if(start_of_line)
3596  {
3597  start_of_line = FALSE;
3598  line_count ++ ;
3599  infoline("%s",prompt);
3600  fflush(output_stream);
3601  }
3602 
3603  c = WaitNextEvent(ptreventflag);
3604 
3605  if(*ptreventflag)
3606  {
3607  if(verbose) printf("<X event>");
3608  if(NOTQUIET) printf("\n"); /* 21.1 */
3609  }
3610 
3611  if(c == EOLN)
3612  start_of_line = TRUE;
3613  }
3614  }
3615 
3616  return c;
3617 }
#define NOTQUIET
Definition: def_macro.h:15
long verbose
Definition: def_glob.h:914
long old_saved_char
Definition: def_glob.h:850
#define NULL
Definition: def_const.h:533
long saved_char
Definition: def_glob.h:849
long line_count
Definition: def_glob.h:1015
#define EOLN
End of line.
Definition: def_const.h:309
void infoline(char *format,...)
infoline
Definition: error.c:281
static long WaitNextEvent(long *ptreventflag)
WaitNextEvent.
Definition: xpred.c:3496
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
FILE * input_stream
Definition: def_glob.h:1014
long start_of_line
???
Definition: def_glob.h:846
char * prompt
Definition: def_glob.h:1018
FILE * output_stream
Definition: def_glob.h:1017
void x_setup_builtins ( )

x_setup_builtins

SETUPBUILTINS Set up the X built-in predicates.

Definition at line 3374 of file xpred.c.

References function_it, new_built_in(), predicate_it, raw_setup_builtins(), set_current_module(), update_symbol(), x_handle_error(), x_handle_fatal_error(), x_module, xcClearWindow(), xcCloseConnection(), xcCoordPut(), xcCreateGC(), xcCreateSimpleWindow(), xcDefaultRootWindow(), xcDestroyGC(), xcDestroyWindow(), xcDrawArc(), xcDrawImageString(), xcDrawLine(), xcDrawPolygon(), xcDrawRectangle(), xcDrawString(), xcFillArc(), xcFillPolygon(), xcFillRectangle(), xcFlushEvents(), xcFreeColor(), xcGetConnectionAttribute(), xcGetEvent(), xcGetGCAttribute(), xcGetScreenAttribute(), xcGetWindowAttribute(), xcGetWindowGeometry(), xcLoadFont(), xcMapSubwindows(), xcMapWindow(), xcMoveWindow(), xcOpenConnection(), xcPointsAlloc(), xcPointsFree(), xcPostScriptWindow(), xcQueryPointer(), xcQueryTextExtents(), xcRaiseWindow(), xcRefreshWindow(), xcRequestColor(), xcRequestNamedColor(), xcResizeWindowPixmap(), xcSelectInput(), xcSetGCAttribute(), xcSetStandardProperties(), xcSetWindowAttribute(), xcSetWindowGeometry(), xcStringWidth(), xcSync(), xcUnloadFont(), xcUnmapSubwindows(), and xcUnmapWindow().

3375 {
3376  set_current_module(x_module); /* RM: Feb 3 1993 */
3377 
3378  raw_setup_builtins(); /* to move in life.c */
3379 
3380  XSetErrorHandler(x_handle_error);
3381  XSetIOErrorHandler(x_handle_fatal_error);
3382 
3383  set_current_module(x_module); /* RM: Feb 3 1993 */
3384  xevent = update_symbol(x_module,"event");
3385  xkeyboard_event = update_symbol(x_module,"keyboard_event");
3386  xbutton_event = update_symbol(x_module,"button_event");
3387  xexpose_event = update_symbol(x_module,"expose_event");
3388  xdestroy_event = update_symbol(x_module,"destroy_event");
3389 
3390  /*** RM: 7/12/92 ***/
3391  xconfigure_event = update_symbol(x_module,"configure_event");
3392  xmotion_event = update_symbol(x_module,"motion_event");
3393  /*** RM: 7/12/92 ***/
3394 
3395 
3396  /*** RM: 3 May 92 ***/
3397  xenter_event = update_symbol(x_module,"enter_event");
3398  xleave_event = update_symbol(x_module,"leave_event");
3399  xmisc_event = update_symbol(x_module,"misc_event");
3400 
3401  /*** RM: 3 May 92 ***/
3402 
3403  xdisplay = update_symbol(x_module,"display");
3404  xdrawable = update_symbol(x_module,"drawable");
3405  xwindow = update_symbol(x_module,"window");
3406  xpixmap = update_symbol(x_module,"pixmap");
3407 
3408  xgc = update_symbol(x_module,"graphic_context");
3409  xdisplaylist = update_symbol(x_module,"display_list");
3410 
3413  new_built_in(x_module,"xcGetScreenAttribute", (def_type) predicate_it,xcGetScreenAttribute);
3414  new_built_in(x_module,"xcGetConnectionAttribute",(def_type) predicate_it,xcGetConnectionAttribute);
3416 
3417  new_built_in(x_module,"xcCreateSimpleWindow", (def_type) predicate_it,xcCreateSimpleWindow);
3418 #if 0
3419  new_built_in(x_module,"xcCreateWindow", (def_type) predicate_it,xcCreateWindow);
3420 #endif
3421 
3422  new_built_in(x_module,"xcSetStandardProperties", (def_type) predicate_it,xcSetStandardProperties);
3425  new_built_in(x_module,"xcGetWindowAttribute", (def_type) predicate_it,xcGetWindowAttribute);
3426  new_built_in(x_module,"xcSetWindowAttribute", (def_type) predicate_it,xcSetWindowAttribute);
3428 
3429  /* RM: May 6 1993 */
3431 
3433 
3434  /*** RM 8/12/92 ***/
3437  /*** RM 8/12/92 ***/
3438 
3440  new_built_in(x_module,"xcResizeWindowPixmap", (def_type) predicate_it,xcResizeWindowPixmap);
3441 
3446 
3451 
3457 
3463 
3467 
3471 
3475 
3479 
3480  /*** RM: 7/12/92 ***/
3482  /*** RM: 7/12/92 ***/
3483 
3484  /* RM: Apr 20 1993 */
3486 }
long xcPointsAlloc()
xcPointsAlloc
Definition: xpred.c:2445
void new_built_in(ptr_module m, char *s, def_type t, long(*r)())
new_built_in
Definition: built_ins.c:5375
long xcSync()
xcSync
Definition: xpred.c:2779
#define function_it
was enum (def_type) in extern.h now there is typedef ptr_definition
Definition: def_const.h:1408
long xcCreateSimpleWindow()
xcCreateSimpleWindow
Definition: xpred.c:816
long xcGetWindowGeometry()
xcGetWindowGeometry
Definition: xpred.c:1087
ptr_definition xdisplaylist
Definition: xpred.c:45
long xcDrawString()
xcDrawString
Definition: xpred.c:2657
long xcRefreshWindow()
xcRefreshWindow
Definition: xpred.c:1714
long xcMoveWindow()
xcMoveWindow
Definition: xpred.c:1288
long xcDrawArc()
xcDrawArc
Definition: xpred.c:2291
ptr_definition xmisc_event
Definition: xpred.c:45
long xcRequestNamedColor()
xcRequestNamedColor
Definition: xpred.c:2189
long xcGetEvent()
xcGetEvent
Definition: xpred.c:3146
long xcLoadFont()
xcLoadFont
Definition: xpred.c:2596
long xcSelectInput()
xcSelectInput
Definition: xpred.c:1689
long xcStringWidth()
xcStringWidth
Definition: xpred.c:2741
long xcDrawRectangle()
xcDrawRectangle
Definition: xpred.c:2330
long xcCoordPut()
xcCoordPut
Definition: xpred.c:2471
long xcDrawLine()
xcDrawLine
Definition: xpred.c:2253
#define predicate_it
was enum (def_type) in extern.h now there is typedef ptr_definition
Definition: def_const.h:1401
long xcPointsFree()
xcPointsFree
Definition: xpred.c:2500
ptr_definition xdrawable
Definition: xpred.c:45
long xcDefaultRootWindow()
xcDefaultRootWindow
Definition: xpred.c:529
long xcGetScreenAttribute()
xcGetScreenAttribute
Definition: xpred.c:752
ptr_definition xdisplay
Definition: xpred.c:45
long xcUnmapWindow()
xcUnmapWindow
Definition: xpred.c:1549
ptr_definition xgc
Definition: xpred.c:45
long xcFillArc()
xcFillArc
Definition: xpred.c:2407
ptr_definition xexpose_event
Definition: xpred.c:45
long xcQueryPointer()
xcQueryPointer
Definition: xpred.c:3322
long xcRequestColor()
xcRequestColor
Definition: xpred.c:2150
long xcDestroyWindow()
xcDestroyWindow
Definition: xpred.c:1773
ptr_definition update_symbol(ptr_module module, char *symbol)
update_symbol
Definition: modules.c:270
ptr_definition xpixmap
Definition: xpred.c:45
long xcDrawPolygon()
xcDrawPolygon
Definition: xpred.c:2523
long xcMapWindow()
xcMapWindow
Definition: xpred.c:1494
long xcDestroyGC()
xcDestroyGC
Definition: xpred.c:2126
long xcFreeColor()
xcFreeColor
Definition: xpred.c:2225
static int x_handle_fatal_error(Display *display)
x_handle_fatal_error
Definition: xpred.c:188
long xcSetGCAttribute()
xcSetGCAttribute
Definition: xpred.c:2094
long xcGetWindowAttribute()
xcGetWindowAttribute
Definition: xpred.c:1221
ptr_definition xwindow
Definition: xpred.c:45
long xcSetWindowGeometry()
xcSetWindowGeometry
Definition: xpred.c:1257
long xcCreateGC()
xcCreateGC
Definition: xpred.c:1810
ptr_definition xconfigure_event
Definition: xpred.c:45
long xcOpenConnection()
xcOpenConnection
Definition: xpred.c:485
ptr_definition xdestroy_event
Definition: xpred.c:45
long xcDrawImageString()
xcDrawImageString
Definition: xpred.c:2699
long xcCloseConnection()
xcCloseConnection
Definition: xpred.c:787
long xcFillPolygon()
xcFillPolygon
Definition: xpred.c:2558
long xcGetGCAttribute()
xcGetGCAttribute
Definition: xpred.c:1942
long xcUnmapSubwindows()
xcUnmapSubwindows
Definition: xpred.c:1604
long xcFillRectangle()
xcFillRectangle
Definition: xpred.c:2368
ptr_definition xmotion_event
Definition: xpred.c:45
long xcGetConnectionAttribute()
xcGetConnectionAttribute
Definition: xpred.c:641
void raw_setup_builtins()
raw_setup_builtins
Definition: raw.c:303
long xcResizeWindowPixmap()
xcResizeWindowPixmap
Definition: xpred.c:1661
long xcRaiseWindow()
xcRaiseWindow
Definition: xpred.c:1522
long xcPostScriptWindow()
xcPostScriptWindow
Definition: xpred.c:1749
ptr_definition xkeyboard_event
Definition: xpred.c:45
long xcClearWindow()
xcClearWindow
Definition: xpred.c:1633
long xcFlushEvents()
xcFlushEvents
Definition: xpred.c:3242
long xcUnloadFont()
xcUnloadFont
Definition: xpred.c:2631
long xcSetWindowAttribute()
xcSetWindowAttribute
Definition: xpred.c:1460
long xcMapSubwindows()
xcMapSubwindows
Definition: xpred.c:1577
ptr_module x_module
'ifdef X11' unnecessary
Definition: def_glob.h:708
ptr_module set_current_module(ptr_module module)
set_current_module
Definition: modules.c:100
ptr_definition xenter_event
Definition: xpred.c:45
long xcSetStandardProperties()
xcSetStandardProperties
Definition: xpred.c:1043
long xcQueryTextExtents()
xcQueryTextExtents
Definition: xpred.c:3933
ptr_definition xevent
Definition: xpred.c:45
ptr_definition xbutton_event
Definition: xpred.c:45
static int x_handle_error(Display *display, XErrorEvent *x_error)
x_handle_error
Definition: xpred.c:170
ptr_definition xleave_event
Definition: xpred.c:45
void x_show_subwindow ( Display *  display,
long  window 
)

x_show_subwindow

Parameters
display- Display *display
window- long window

used when backtracking a xcUnmapWindow in order to show the window

Definition at line 3901 of file xpred.c.

3902 {
3903  XMapSubwindows(display,window);
3904  XSync(display,0);
3905 }
void x_show_window ( Display *  display,
long  window 
)

x_show_window

Parameters
display- Display *display
window- long window

used when backtracking a xcUnmapWindow in order to show the window

Definition at line 3871 of file xpred.c.

3872 {
3873  XMapWindow(display,window);
3874  XSync(display,0);
3875 }
static long x_union_event ( ptr_psi_term  psiEvent,
EventClosure closure 
)
static

x_union_event

Parameters
psiEvent- ptr_psi_term psiEvent
closure- EventClosure *closure

Static return FALSE if the events match

Definition at line 3130 of file xpred.c.

References wl_EventClosure::display, GetIntAttr(), wl_EventClosure::mask, and wl_EventClosure::window.

3131 {
3132  return !((Display *)GetIntAttr(psiEvent,"display") == closure->display
3133  && (Window)GetIntAttr(psiEvent,"window") == closure->window
3134  &&(GetIntAttr(psiEvent,"mask") & closure->mask) != 0);
3135 }
Display * display
Definition: xpred.c:32
long mask
Definition: xpred.c:34
Window window
Definition: xpred.c:33
long GetIntAttr(ptr_psi_term psiTerm, char *attributeName)
GetIntAttr.
Definition: xpred.c:333
static ptr_psi_term x_what_psi_event ( ptr_psi_term  beginSpan,
ptr_psi_term  endSpan,
long  eventType 
)
static

x_what_psi_event

Parameters
beginSpan- ptr_psi_term beginSpan
endSpan- ptr_psi_term endSpan
eventType- long eventType

Static returns the psi-event of the list corresponding to the existing event

Definition at line 3653 of file xpred.c.

References GetIntAttr(), list_car(), list_cdr(), and mask_match_type().

3654 {
3655  if(beginSpan == endSpan)
3656  return list_car(beginSpan);
3657  else
3658  if(mask_match_type(GetIntAttr(list_car(beginSpan),"mask"),
3659  eventType))
3660  return list_car(beginSpan);
3661  else
3662  return x_what_psi_event(list_cdr(beginSpan),
3663  endSpan,eventType);
3664 }
ptr_psi_term list_car(ptr_psi_term lst)
list_car
Definition: xpred.c:2963
static ptr_psi_term x_what_psi_event(ptr_psi_term beginSpan, ptr_psi_term endSpan, long eventType)
x_what_psi_event
Definition: xpred.c:3653
static long mask_match_type(long mask, long type)
mask_match_type
Definition: xpred.c:3628
ptr_psi_term list_cdr(ptr_psi_term lst)
list_cdr
Definition: xpred.c:2936
long GetIntAttr(ptr_psi_term psiTerm, char *attributeName)
GetIntAttr.
Definition: xpred.c:333
long xcClearWindow ( )

xcClearWindow

xcClearWindow xcClearWindow(+Connection,+Window) clear the Window on the display Connection.

Definition at line 1633 of file xpred.c.

References begin_builtin, DISP, end_builtin, include_var_builtin, real, TRUE, WIND, WindowDisplayList, x_free_display_list(), and xwindow.

1634 {
1636  ptr_definition types[2];
1637 
1638  types[0] = real;
1639  types[1] = xwindow;
1640 
1641  begin_builtin(xcClearWindow,2,2,types);
1642 
1643  XClearWindow(DISP(0),WIND(1));
1644 XSync(DISP(0),0);
1645 
1647  success = TRUE;
1648 
1649  end_builtin();
1650 }
#define WindowDisplayList(w)
Definition: xpred.c:146
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
ptr_definition xwindow
Definition: xpred.c:45
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define DISP(X)
Definition: xpred.c:149
void x_free_display_list(ListHeader *displaylist)
x_free_display_list
Definition: xdisplaylist.c:548
long xcClearWindow()
xcClearWindow
Definition: xpred.c:1633
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define WIND(X)
Definition: xpred.c:151
#define end_builtin()
Definition: def_macro.h:259
long xcCloseConnection ( )

xcCloseConnection

xcCloseConnection xcCloseConnection(+Connection) Close the connection.

Definition at line 787 of file xpred.c.

References begin_builtin, DISP, end_builtin, include_var_builtin, real, and TRUE.

788 {
790  ptr_definition types[1];
791 
792 
793  types[0] = real;
794 
795  begin_builtin(xcCloseConnection,1,1,types);
796 
797  XCloseDisplay(DISP(0));
798  success = TRUE;
799 
800  end_builtin();
801 }
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
#define TRUE
Standard boolean.
Definition: def_const.h:268
long xcCloseConnection()
xcCloseConnection
Definition: xpred.c:787
#define DISP(X)
Definition: xpred.c:149
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcCoordPut ( )

xcCoordPut

CoordPut xcCoordPut(+Points,+N,+Coord) put nth coordinate in Points

Definition at line 2471 of file xpred.c.

References begin_builtin, end_builtin, include_var_builtin, real, and TRUE.

2472 {
2474  ptr_definition types[3];
2475  short *Points;
2476 
2477  types[0] = real;
2478  types[1] = real;
2479  types[2] = real;
2480 
2481  begin_builtin(xcCoordPut,3,3,types);
2482 
2483  Points =(short *) val [0];
2484  Points += val[1];
2485  *Points = val[2];
2486 
2487  success = TRUE;
2488 
2489  end_builtin();
2490 }
long xcCoordPut()
xcCoordPut
Definition: xpred.c:2471
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcCreateGC ( )

xcCreateGC

CREATEGC xcCreateGC(+Connection,+Drawable,-GC) create a graphic context.

Definition at line 1810 of file xpred.c.

References begin_builtin, DISP, end_builtin, Errorline(), FALSE, include_var_builtin, REAL, real, TRUE, unify_real_result(), WIND, and xdrawable.

1811 {
1813  ptr_definition types[3];
1814  GC gc;
1815  XGCValues GCvalues;
1816 
1817  types[0] = real;
1818  types[1] = xdrawable;
1819  types[2] = real;
1820 
1821  begin_builtin(xcCreateGC,3,2,types);
1822 
1823  if(gc = XCreateGC(DISP(0),WIND(1),0,&GCvalues)) /* RM: Feb 7 1994 */
1824  {
1825  unify_real_result(args[2],(REAL)(unsigned long) gc);
1826  success = TRUE;
1827  }
1828  else
1829  {
1830  Errorline("could not create gc in %P.\n",g);
1831  success = FALSE;
1832  }
1833 
1834  end_builtin();
1835 }
ptr_definition xdrawable
Definition: xpred.c:45
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
Definition: def_const.h:132
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
long xcCreateGC()
xcCreateGC
Definition: xpred.c:1810
#define DISP(X)
Definition: xpred.c:149
long unify_real_result(ptr_psi_term t, REAL v)
unify_real_result
Definition: built_ins.c:386
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define WIND(X)
Definition: xpred.c:151
#define end_builtin()
Definition: def_macro.h:259
long xcCreateSimpleWindow ( )

xcCreateSimpleWindow

xcCreateSimpleWindow

xcCreateSimpleWindow(+Display,+Parent,+X,+Y,+Width,+Height, +BackGroundColor,+WindowTitle,+IconTitle, +BorderWidth,+BorderColor, +Permanent,+Show,-Window)

create a simple window.

Definition at line 816 of file xpred.c.

References arg_c, arg_v, begin_builtin, bk_change_psi_attr(), bk_stack_add_int_attr(), boolean, destroy_window, DISP, end_builtin, Errorline(), FALSE, include_var_builtin, NewPsi(), NULL, push_goal(), push_window(), quoted_string, real, ResizePixmap(), show(), show_window, stack_psi_term(), STRG, TRUE, wl_psi_term::type, unify, WIND, x_display_list(), x_show_window(), x_window_creation, and xwindow.

817 {
819  ptr_definition types[14];
820  Window window;
821  Pixmap life_icon;
822  XSizeHints hints;
823  XWindowChanges changes;
824  unsigned long changesMask;
825  XSetWindowAttributes attributes;
826  unsigned long attributesMask;
827  long j;
828  long permanent,show;
829  Display *display;
830  GC gc;
831  XGCValues gcvalues;
832  ptr_psi_term psiWindow;
833 
834  for(j = 0; j < 14; j++)
835  types[j] = real;
836  types[7]= quoted_string;
837  types[8]= quoted_string;
838  types[11]= boolean;
839  types[12]= boolean;
840 
841  begin_builtin(xcCreateSimpleWindow,14,13,types);
842 
843  permanent = val[11];
844  show = val[12];
845 
846  if(window = XCreateSimpleWindow(DISP(0),WIND(1),/* display,parent */
847  val[2],val[3],/* X,Y */
848  val[4],val[5],/* Width,Height */
849  val[9],val[10],/* BorderWidth,BorderColor */
850  val[6])) /* BackGround */
851  {
852  psiWindow = stack_psi_term(4);
853  psiWindow->type = xwindow;
854  bk_stack_add_int_attr(psiWindow,"id",(long)window); // added cast DJD
855 
856  /* attach the icon of life */
857  life_icon = XCreateBitmapFromData(DISP(0),window,life_icon_bits,
858  life_icon_width,life_icon_height);
859  /* set properties */
860 #if 0
861  hints.x = val[2];
862  hints.y = val[3];
863  hints.width =val[4] ;
864  hints.height = val[5];
865  hints.flags = PPosition | PSize;
866 #endif
867  hints.flags = 0;
868  XSetStandardProperties(DISP(0),window,
869  STRG(7),STRG(8),
870  life_icon,arg_v,arg_c,
871  &hints);
872 #if 0
873  changes.x = val[2];
874  changes.y = val[3];
875  changes.width =val[4] ;
876  changes.height = val[5];
877  changesMask = CWX | CWY | CWWidth | CWHeight;
878  display = DISP(0);
879  XReconfigureWMWindow(DISP(0),window,DefaultScreen(display),
880  changesMask,&changes);
881 #endif
882  /* set the background color */
883  XSetWindowBackground(DISP(0),window,val[6]);
884 #if 0
885  /* set the geometry before to show the window */
886  XMoveResizeWindow(DISP(0),window,
887  val[2],val[3],val[4],val[5]);
888 #endif
889  /* set the back pixel in order to have the color when deiconify */
890  attributes.background_pixel = val[6];
891  attributes.backing_pixel = val[6];
892  attributesMask = CWBackingPixel|CWBackPixel;
893  XChangeWindowAttributes(DISP(0),window,
894  attributesMask,&attributes);
895 
896  if(!permanent)
897  {
898  push_window(destroy_window,(long)DISP(0),window);
900  }
901  else
902  if(show)
903  push_window(show_window,(long)DISP(0),window);
904 
905 #if 0
906  /* map window is made in xCreateWindow(see xpred.lf) */
907  /* due to the flag overrideRedirect */
908  if(show)
909  x_show_window(DISP(0),window);
910 #endif
911 
912  /* create a GC on the window for the next outputs */
913  gcvalues.cap_style = CapRound;
914  gcvalues.join_style = JoinRound;
915  gc = XCreateGC(DISP(0),window,GCJoinStyle|GCCapStyle,&gcvalues);
916  bk_change_psi_attr(psiWindow,"graphic_context",
917  NewPsi(xgc,"id",(long)gc)); // added cast DJD
918 
919  /* init a display list on the window for the refresh window */
920  bk_change_psi_attr(psiWindow,"display_list",
921  NewPsi(xdisplaylist,"id",(long)x_display_list())); // added cast DJD
922 
923  /* init a pixmap on the window for the refresh mechanism */
924  bk_change_psi_attr(psiWindow,"pixmap",
925  NewPsi(xpixmap,"id",(long)NULL));
926  ResizePixmap(psiWindow,DISP(0),window,val[4],val[5]);
927 
928  push_goal(unify,psiWindow,args[13],NULL);
929  success = TRUE;
930  }
931  else
932  {
933  Errorline("could not create a simple window in %P.\n",g);
934  success = FALSE;
935  }
936 
937  end_builtin();
938 }
#define STRG(X)
Definition: xpred.c:155
long xcCreateSimpleWindow()
xcCreateSimpleWindow
Definition: xpred.c:816
ptr_definition xdisplaylist
Definition: xpred.c:45
void show(long limit)
show
Definition: parser.c:64
#define show_window
To backtrack on show window.
Definition: def_const.h:456
void push_goal(goals t, ptr_psi_term a, ptr_psi_term b, GENERIC c)
push_goal
Definition: login.c:600
void x_show_window(Display *display, long window)
x_show_window
Definition: xpred.c:3871
#define destroy_window
To backtrack on window creation.
Definition: def_const.h:449
ptr_definition xgc
Definition: xpred.c:45
#define NULL
Definition: def_const.h:533
ptr_definition boolean
symbol in bi module
Definition: def_glob.h:185
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition xpixmap
Definition: xpred.c:45
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
ptr_definition xwindow
Definition: xpred.c:45
int arg_c
set from argc in either life.c or lib.c
Definition: def_glob.h:20
#define TRUE
Standard boolean.
Definition: def_const.h:268
long x_window_creation
Definition: xpred.c:53
#define FALSE
Standard boolean.
Definition: def_const.h:275
ptr_psi_term stack_psi_term(long stat)
stack_psi_term
Definition: lefun.c:21
#define unify
was enum (goal) – but must be long for error.c - now typedef
Definition: def_const.h:1058
#define DISP(X)
Definition: xpred.c:149
char * arg_v[ARGNN]
set from argv in either life.c or lib.c
Definition: def_glob.h:27
void bk_change_psi_attr(ptr_psi_term t, char *attrname, ptr_psi_term value)
bk_change_psi_attr
Definition: xpred.c:240
void push_window(long type, long disp, long wind)
push_window
Definition: login.c:548
void bk_stack_add_int_attr(ptr_psi_term t, char *attrname, long value)
bk_stack_add_int_attr
Definition: xpred.c:206
static ptr_psi_term NewPsi(ptr_definition t, char *f, long v)
ptr_psi_term NewPsi
Definition: xpred.c:314
static void ResizePixmap(ptr_psi_term psi_window, Display *display, Window window, unsigned long width, unsigned long height)
ResizePixmap.
Definition: xpred.c:400
ptr_definition type
Definition: def_struct.h:181
ListHeader * x_display_list()
x_display_list
Definition: xdisplaylist.c:120
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define WIND(X)
Definition: xpred.c:151
#define end_builtin()
Definition: def_macro.h:259
ptr_definition quoted_string
symbol in bi module
Definition: def_glob.h:368
long xcDefaultRootWindow ( )

xcDefaultRootWindow

xcDefaultRootWindow xcDefaultRootWindow(+Display,-Root) return the root window of the given display

Definition at line 529 of file xpred.c.

References begin_builtin, DISP, end_builtin, include_var_builtin, NewPsi(), NULL, push_goal(), real, TRUE, unify, and xdrawable.

530 {
532  ptr_definition types[2];
533  Display *display;
534  ptr_psi_term psiRoot;
535 
536  types[0] = real;
537  types[1] = xdrawable;
538 
540 
541  display = DISP(0);
542 
543  psiRoot = NewPsi(xwindow,"id",(long)DefaultRootWindow(display)); // added cast DJD
544 
545  push_goal(unify,psiRoot,args[1],NULL);
546  success = TRUE;
547 
548  end_builtin();
549 }
void push_goal(goals t, ptr_psi_term a, ptr_psi_term b, GENERIC c)
push_goal
Definition: login.c:600
ptr_definition xdrawable
Definition: xpred.c:45
long xcDefaultRootWindow()
xcDefaultRootWindow
Definition: xpred.c:529
#define NULL
Definition: def_const.h:533
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
ptr_definition xwindow
Definition: xpred.c:45
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define unify
was enum (goal) – but must be long for error.c - now typedef
Definition: def_const.h:1058
#define DISP(X)
Definition: xpred.c:149
static ptr_psi_term NewPsi(ptr_definition t, char *f, long v)
ptr_psi_term NewPsi
Definition: xpred.c:314
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcDestroyGC ( )

xcDestroyGC

DESTROYGC xcDestroyGC(+Connection,+GC) destroys a graphic context.

Definition at line 2126 of file xpred.c.

References begin_builtin, DISP, end_builtin, GCVAL, include_var_builtin, real, and TRUE.

2127 {
2129  ptr_definition types[2];
2130 
2131  types[0] = real;
2132  types[1] = real;
2133 
2134  begin_builtin(xcDestroyGC,2,2,types);
2135 
2136  XFreeGC(DISP(0),GCVAL(1));
2137  success = TRUE;
2138 
2139  end_builtin();
2140 }
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
long xcDestroyGC()
xcDestroyGC
Definition: xpred.c:2126
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define GCVAL(X)
Definition: xpred.c:152
#define DISP(X)
Definition: xpred.c:149
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcDestroyWindow ( )

xcDestroyWindow

xcDestroyWindow xcDestroyWindow(+Connection,+Window) Close and destroy the window(unbacktrable).

Definition at line 1773 of file xpred.c.

References begin_builtin, clean_undo_window(), DISP, end_builtin, Errorline(), exit_life(), FALSE, FreeWindow(), GetPsiAttr(), include_var_builtin, wl_definition::keyword, real, wl_keyword::symbol, TRUE, wl_psi_term::type, WIND, and xwindow.

1774 {
1776  ptr_definition types[2];
1777  ptr_psi_term psi;
1778 
1779  types[0] = real;
1780  types[1] = xwindow;
1781 
1782  begin_builtin(xcDestroyWindow,2,2,types);
1783 
1784  psi = GetPsiAttr(args[1],"permanent");
1785  if(!strcmp(psi->type->keyword->symbol,"true"))
1786  {
1787  Errorline("cannot destroy a permanent window.\n");
1788  exit_life(TRUE); /* was: main_loop_ok=FALSE; - jch */
1789  success = FALSE;
1790  }
1791  else
1792  {
1793  FreeWindow((Display *)val[0],args[1]);
1794  XDestroyWindow(DISP(0),WIND(1));
1795 XSync(DISP(0),0);
1796  clean_undo_window((long)DISP(0),WIND(1));
1797  success = TRUE;
1798  }
1799 
1800  end_builtin();
1801 }
void exit_life(long nl_flag)
exit_life
Definition: built_ins.c:2219
ptr_keyword keyword
Definition: def_struct.h:147
ptr_psi_term GetPsiAttr(ptr_psi_term psiTerm, char *attributeName)
GetPsiAttr.
Definition: xpred.c:367
char * symbol
Definition: def_struct.h:118
static void FreeWindow(Display *display, ptr_psi_term psi_window)
FreeWindow.
Definition: xpred.c:463
long xcDestroyWindow()
xcDestroyWindow
Definition: xpred.c:1773
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
ptr_definition xwindow
Definition: xpred.c:45
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
void clean_undo_window(long disp, long wind)
clean_undo_window
Definition: login.c:848
#define DISP(X)
Definition: xpred.c:149
ptr_definition type
Definition: def_struct.h:181
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define WIND(X)
Definition: xpred.c:151
#define end_builtin()
Definition: def_macro.h:259
long xcDrawArc ( )

xcDrawArc

DrawArc xcDrawArc(+Connection,+Drawable,+X,+Y,+Width,+Height,+StartAngle,+ArcAngle, +Function,+Color,+LineWidth) draw arc(see X Vol.2 page 135 for the meanings of the arguments).

Definition at line 2291 of file xpred.c.

References begin_builtin, DISP, DrawableGC, end_builtin, include_var_builtin, real, TRUE, WindowDisplayList, x_record_arc(), x_set_gc(), xDefaultFont, and xdrawable.

2292 {
2293  include_var_builtin(11);
2294  ptr_definition types[11];
2295  long j;
2296  GC gc;
2297 
2298  for(j = 0; j < 11; j++)
2299  types[j] = real;
2300  types[1] = xdrawable;
2301 
2302  begin_builtin(xcDrawArc,11,11,types);
2303 
2304  gc = DrawableGC(args[1]);
2305  x_set_gc((Display *)val[0],gc,val[8],val[9],val[10],xDefaultFont);
2306 
2307  XDrawArc(DISP(0),(Window) val[1],gc,/* Display,Window,GC */
2308  val[2],val[3],val[4],val[5], /* X,Y,Width,Height */
2309  val[6],val[7]); /* StartAngle,ArcAngle */
2310 
2311  x_record_arc((ListHeader *)WindowDisplayList(args[1]),DRAW_ARC,
2312  val[2],val[3],val[4],val[5],
2313  val[6],val[7],val[8],val[9],val[10]);
2314 
2315 XSync(DISP(0),0);
2316  success = TRUE;
2317 
2318  end_builtin();
2319 }
void x_record_arc(ListHeader *displaylist, Action action, long x, long y, long width, long height, long startangle, long arcangle, unsigned long function, unsigned long color, unsigned long linewidth)
x_record_arc
Definition: xdisplaylist.c:221
long xcDrawArc()
xcDrawArc
Definition: xpred.c:2291
ptr_definition xdrawable
Definition: xpred.c:45
#define WindowDisplayList(w)
Definition: xpred.c:146
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void x_set_gc(Display *display, GC gc, long function, unsigned long color, long linewidth, Font font)
x_set_gc
Definition: xdisplaylist.c:142
#define DrawableGC(w)
Definition: xpred.c:145
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define xDefaultFont
Definition: def_const.h:943
#define DISP(X)
Definition: xpred.c:149
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcDrawImageString ( )

xcDrawImageString

DrawImageString xcDrawImageString(+Connection,+Drawable,+X,+Y,String, +Font,+Function,+Color) Print the string(foreground+background).

Definition at line 2699 of file xpred.c.

References begin_builtin, DISP, DrawableGC, end_builtin, include_var_builtin, quoted_string, real, STRG, TRUE, WIND, WindowDisplayList, x_record_string(), x_set_gc(), xDefaultLineWidth, and xdrawable.

2700 {
2702  ptr_definition types[8];
2703  long j;
2704  GC gc;
2705 
2706  for(j = 0; j < 8; j++)
2707  types[j] = real;
2708  types[1] = xdrawable;
2709  types[4] = quoted_string;
2710 
2711  begin_builtin(xcDrawImageString,8,8,types);
2712 
2713  gc = DrawableGC(args[1]);
2714  x_set_gc((Display *)val[0],gc,val[6],val[7],xDefaultLineWidth,val[5]);
2715 
2716  XDrawImageString(DISP(0),WIND(1),gc, /* Display,Window,GC */
2717  val[2],val[3], /* X,Y */
2718  STRG(4), /* String */
2719  strlen(STRG(4))); /* Length */
2720 
2721  x_record_string((ListHeader *)WindowDisplayList(args[1]),DRAW_IMAGE_STRING,
2722  val[2],val[3], /* X,Y */
2723  STRG(4), /* String */
2724  val[5], /* Font */
2725  val[6],val[7]); /* Function,Color */
2726 
2727  XSync(DISP(0),0);
2728  success = TRUE;
2729 
2730  end_builtin();
2731 }
#define STRG(X)
Definition: xpred.c:155
#define xDefaultLineWidth
Definition: def_const.h:944
ptr_definition xdrawable
Definition: xpred.c:45
#define WindowDisplayList(w)
Definition: xpred.c:146
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void x_set_gc(Display *display, GC gc, long function, unsigned long color, long linewidth, Font font)
x_set_gc
Definition: xdisplaylist.c:142
#define DrawableGC(w)
Definition: xpred.c:145
#define TRUE
Standard boolean.
Definition: def_const.h:268
long xcDrawImageString()
xcDrawImageString
Definition: xpred.c:2699
#define DISP(X)
Definition: xpred.c:149
void x_record_string(ListHeader *displaylist, Action action, long x, long y, char *str, Font font, unsigned long function, unsigned long color)
x_record_string
Definition: xdisplaylist.c:318
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define WIND(X)
Definition: xpred.c:151
#define end_builtin()
Definition: def_macro.h:259
ptr_definition quoted_string
symbol in bi module
Definition: def_glob.h:368
long xcDrawLine ( )

xcDrawLine

DrawLine xcDrawLine(+Connection,+Drawable,+X0,+Y0,+X1,+Y1, +Function,+Color,+LineWidth) draw a line(X0,Y0) ->(X1,Y1)

Definition at line 2253 of file xpred.c.

References begin_builtin, DISP, DrawableGC, end_builtin, include_var_builtin, real, TRUE, WindowDisplayList, x_record_line(), x_set_gc(), xDefaultFont, and xdrawable.

2254 {
2256  ptr_definition types[9];
2257  long j;
2258  GC gc;
2259 
2260  for(j = 0; j < 9; j++)
2261  types[j] = real;
2262  types[1] = xdrawable;
2263 
2264  begin_builtin(xcDrawLine,9,9,types);
2265 
2266  gc = DrawableGC(args[1]);
2267  x_set_gc((Display *)val[0],gc,val[6],val[7],val[8],xDefaultFont);
2268 
2269  XDrawLine(DISP(0),(Window) val[1],gc,/* Display,Window,GC */
2270  val[2],val[3],val[4],val[5]); /* X0,Y0,X1,Y1 */
2271 
2272  x_record_line((ListHeader *)WindowDisplayList(args[1]),DRAW_LINE,
2273  val[2],val[3],val[4],val[5],
2274  val[6],val[7],val[8]);
2275 
2276 XSync(DISP(0),0);
2277  success = TRUE;
2278 
2279  end_builtin();
2280 }
long xcDrawLine()
xcDrawLine
Definition: xpred.c:2253
ptr_definition xdrawable
Definition: xpred.c:45
#define WindowDisplayList(w)
Definition: xpred.c:146
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void x_set_gc(Display *display, GC gc, long function, unsigned long color, long linewidth, Font font)
x_set_gc
Definition: xdisplaylist.c:142
#define DrawableGC(w)
Definition: xpred.c:145
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define xDefaultFont
Definition: def_const.h:943
#define DISP(X)
Definition: xpred.c:149
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
void x_record_line(ListHeader *displaylist, Action action, long x0, long y0, long x1, long y1, unsigned long function, unsigned long color, unsigned long linewidth)
x_record_line
Definition: xdisplaylist.c:186
#define end_builtin()
Definition: def_macro.h:259
long xcDrawPolygon ( )

xcDrawPolygon

DrawPolygon xcDrawPolygon(+Connection,+Drawable,+Points,+NbPoints, +Function,+Color,+LineWidth) draw a polygon.

Definition at line 2523 of file xpred.c.

References begin_builtin, DISP, DrawableGC, end_builtin, include_var_builtin, real, TRUE, WindowDisplayList, x_record_polygon(), x_set_gc(), xDefaultFont, and xdrawable.

2524 {
2526  ptr_definition types[7];
2527  long j;
2528  GC gc;
2529 
2530  for(j = 0; j < 7; j++)
2531  types[j] = real;
2532  types[1] = xdrawable;
2533 
2534  begin_builtin(xcDrawPolygon,7,7,types);
2535 
2536  gc = DrawableGC(args[1]);
2537  x_set_gc((Display *)val[0],gc,val[4],val[5],val[6],xDefaultFont);
2538 
2539  XDrawLines(DISP(0),(Window) val[1],gc,/* Display,Window,GC */
2540  (XPoint *)val[2],val[3],CoordModeOrigin); /* Points,NbPoints,mode */
2541 
2542  x_record_polygon((ListHeader *)WindowDisplayList(args[1]),DRAW_POLYGON,
2543  (XPoint *)val[2],val[3],val[4],val[5],val[6]);
2544 
2545 XSync(DISP(0),0);
2546  success = TRUE;
2547 
2548  end_builtin();
2549 }
ptr_definition xdrawable
Definition: xpred.c:45
#define WindowDisplayList(w)
Definition: xpred.c:146
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
long xcDrawPolygon()
xcDrawPolygon
Definition: xpred.c:2523
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void x_record_polygon(ListHeader *displaylist, Action action, XPoint *points, long npoints, unsigned long function, unsigned long color, unsigned long linewidth)
x_record_polygon
Definition: xdisplaylist.c:285
void x_set_gc(Display *display, GC gc, long function, unsigned long color, long linewidth, Font font)
x_set_gc
Definition: xdisplaylist.c:142
#define DrawableGC(w)
Definition: xpred.c:145
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define xDefaultFont
Definition: def_const.h:943
#define DISP(X)
Definition: xpred.c:149
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcDrawRectangle ( )

xcDrawRectangle

DrawRectangle xcDrawRectangle(+Connection,+Drawable,+X,+Y,+Width,+Height, +Function,+Color,+LineWidth) draw a rectangle.

Definition at line 2330 of file xpred.c.

References begin_builtin, DISP, DrawableGC, end_builtin, include_var_builtin, real, TRUE, WindowDisplayList, x_record_rectangle(), x_set_gc(), xDefaultFont, and xdrawable.

2331 {
2333  ptr_definition types[9];
2334  long j;
2335  GC gc;
2336 
2337  for(j = 0; j < 9; j++)
2338  types[j] = real;
2339  types[1] = xdrawable;
2340 
2341  begin_builtin(xcDrawRectangle,9,9,types);
2342 
2343  gc = DrawableGC(args[1]);
2344  x_set_gc((Display *)val[0],gc,val[6],val[7],val[8],xDefaultFont);
2345 
2346  XDrawRectangle(DISP(0),(Window) val[1],gc,/* Display,Window,GC */
2347  val[2],val[3],val[4],val[5]); /* X,Y,Width,Height */
2348 
2349  x_record_rectangle((ListHeader *)WindowDisplayList(args[1]),DRAW_RECTANGLE,
2350  val[2],val[3],val[4],val[5],
2351  val[6],val[7],val[8]);
2352 
2353 XSync(DISP(0),0);
2354  success = TRUE;
2355 
2356  end_builtin();
2357 }
long xcDrawRectangle()
xcDrawRectangle
Definition: xpred.c:2330
void x_record_rectangle(ListHeader *displaylist, Action action, long x, long y, long width, long height, unsigned long function, unsigned long color, unsigned long linewidth)
x_record_rectangle
Definition: xdisplaylist.c:255
ptr_definition xdrawable
Definition: xpred.c:45
#define WindowDisplayList(w)
Definition: xpred.c:146
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void x_set_gc(Display *display, GC gc, long function, unsigned long color, long linewidth, Font font)
x_set_gc
Definition: xdisplaylist.c:142
#define DrawableGC(w)
Definition: xpred.c:145
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define xDefaultFont
Definition: def_const.h:943
#define DISP(X)
Definition: xpred.c:149
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcDrawString ( )

xcDrawString

DrawString xcDrawString(+Connection,+Drawable,+X,+Y,String, +Font,+Function,+Color) Print the string(only foreground).

Definition at line 2657 of file xpred.c.

References begin_builtin, DISP, DrawableGC, end_builtin, include_var_builtin, quoted_string, real, STRG, TRUE, WindowDisplayList, x_record_string(), x_set_gc(), xDefaultLineWidth, and xdrawable.

2658 {
2660  ptr_definition types[8];
2661  long j;
2662  GC gc;
2663 
2664  for(j = 0; j < 8; j++)
2665  types[j] = real;
2666  types[1] = xdrawable;
2667  types[4] = quoted_string;
2668 
2669  begin_builtin(xcDrawString,8,8,types);
2670 
2671  gc = DrawableGC(args[1]);
2672  x_set_gc((Display *)val[0],gc,val[6],val[7],xDefaultLineWidth,val[5]);
2673 
2674  XDrawString(DISP(0),(Window) val[1],gc, /* Display,Window,GC */
2675  val[2],val[3],STRG(4), /* X,Y *//* String */
2676  strlen(STRG(4))); /* Length */
2677 
2678  x_record_string((ListHeader *)WindowDisplayList(args[1]),DRAW_STRING,
2679  val[2],val[3], /* X,Y */
2680  STRG(4), /* String */
2681  val[5], /* Font */
2682  val[6],val[7]); /* Function,Color */
2683 
2684  XSync(DISP(0),0);
2685  success = TRUE;
2686 
2687  end_builtin();
2688 }
#define STRG(X)
Definition: xpred.c:155
#define xDefaultLineWidth
Definition: def_const.h:944
long xcDrawString()
xcDrawString
Definition: xpred.c:2657
ptr_definition xdrawable
Definition: xpred.c:45
#define WindowDisplayList(w)
Definition: xpred.c:146
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void x_set_gc(Display *display, GC gc, long function, unsigned long color, long linewidth, Font font)
x_set_gc
Definition: xdisplaylist.c:142
#define DrawableGC(w)
Definition: xpred.c:145
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define DISP(X)
Definition: xpred.c:149
void x_record_string(ListHeader *displaylist, Action action, long x, long y, char *str, Font font, unsigned long function, unsigned long color)
x_record_string
Definition: xdisplaylist.c:318
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
ptr_definition quoted_string
symbol in bi module
Definition: def_glob.h:368
static ptr_psi_term xcEventToPsiTerm ( XEvent *  event)
static

xcEventToPsiTerm

Parameters
event- XEvent *event

EVENTtoPSITERM

Definition at line 2802 of file xpred.c.

References bk_stack_add_int_attr(), BS, buffer, CR, NULL, stack_psi_term(), wl_psi_term::type, xbutton_event, xconfigure_event, xdestroy_event, xenter_event, xexpose_event, xkeyboard_event, xleave_event, xmisc_event, and xmotion_event.

2803 {
2804  ptr_psi_term psiEvent,psi_str;
2805  KeySym keysym;
2806  char buffer[10];
2807  char tstr[2], *str;
2808 
2809  str=tstr;
2810  tstr[1]=0;
2811 
2812  psiEvent = stack_psi_term(4);
2813  bk_stack_add_int_attr(psiEvent,"display",(long)event->xany.display);
2814  bk_stack_add_int_attr(psiEvent,"window",(long)event->xany.window);
2815 
2816  switch(event->type) {
2817  case KeyPress:
2818  case KeyRelease:
2819  psiEvent->type = xkeyboard_event;
2820  bk_stack_add_int_attr(psiEvent,"x",event->xkey.x);
2821  bk_stack_add_int_attr(psiEvent,"y",event->xkey.y);
2822  bk_stack_add_int_attr(psiEvent,"state",event->xkey.state);
2823 
2824  buffer[0] = 0;
2825  *str = 0;
2826  XLookupString((XKeyEvent*)event,buffer,sizeof(buffer),&keysym,NULL);
2827  bk_stack_add_int_attr(psiEvent,"keycode",(long)buffer[0]);
2828  if(keysym==XK_Return || keysym==XK_KP_Enter || keysym==XK_Linefeed)
2829  *str = CR;
2830  else
2831  if(keysym == XK_BackSpace || keysym == XK_Delete)
2832  *str = BS;
2833  else
2834  if(isascii(buffer[0]))
2835  /* if(isalnum(buffer[0]) || isspace(buffer[0])) 8.10 */
2836  *str = buffer[0];
2837 
2838  bk_stack_add_int_attr(psiEvent,"char",(long)*str);
2839  break;
2840 
2841  case ButtonPress:
2842  case ButtonRelease:
2843  psiEvent->type = xbutton_event;
2844  bk_stack_add_int_attr(psiEvent,"x",(long)event->xbutton.x);
2845  bk_stack_add_int_attr(psiEvent,"y",(long)event->xbutton.y);
2846  bk_stack_add_int_attr(psiEvent,"x_root",(long)event->xbutton.x_root);
2847  bk_stack_add_int_attr(psiEvent,"y_root",(long)event->xbutton.y_root);
2848  bk_stack_add_int_attr(psiEvent,"state",(long)event->xbutton.state);
2849  bk_stack_add_int_attr(psiEvent,"button",(long)event->xbutton.button);
2850  break;
2851 
2852  case Expose:
2853  psiEvent->type = xexpose_event;
2854  bk_stack_add_int_attr(psiEvent,"width",(long)event->xexpose.width);
2855  bk_stack_add_int_attr(psiEvent,"height",(long)event->xexpose.height);
2856  break;
2857 
2858  case DestroyNotify:
2859  psiEvent->type = xdestroy_event;
2860  break;
2861 
2862  /*** RM 7/12/92 ***/
2863  case MotionNotify:
2864  psiEvent->type = xmotion_event;
2865  bk_stack_add_int_attr(psiEvent,"x",(long)event->xbutton.x);
2866  bk_stack_add_int_attr(psiEvent,"y",(long)event->xbutton.y);
2867  bk_stack_add_int_attr(psiEvent,"x_root",(long)event->xbutton.x_root);
2868  bk_stack_add_int_attr(psiEvent,"y_root",(long)event->xbutton.y_root);
2869  break;
2870 
2871  case ConfigureNotify:
2872  psiEvent->type = xconfigure_event;
2873  bk_stack_add_int_attr(psiEvent,"x",(long)event->xconfigure.x);
2874  bk_stack_add_int_attr(psiEvent,"y",(long)event->xconfigure.y);
2875  bk_stack_add_int_attr(psiEvent,"width",(long)event->xconfigure.width);
2876  bk_stack_add_int_attr(psiEvent,"height",(long)event->xconfigure.height);
2877  bk_stack_add_int_attr(psiEvent,"border_width",
2878  (long)event->xconfigure.border_width);
2879  break;
2880  /*** RM 7/12/92(END) ***/
2881 
2882 
2883  /*** RM: May 3rd 1993 ***/
2884  case EnterNotify:
2885  psiEvent->type = xenter_event;
2886  goto LeaveEnterCommon;
2887 
2888  case LeaveNotify:
2889  psiEvent->type = xleave_event;
2890 
2891  LeaveEnterCommon:
2892  bk_stack_add_int_attr(psiEvent,"root", (long) event->xcrossing.root);
2893  bk_stack_add_int_attr(psiEvent,"subwindow",(long)event->xcrossing.subwindow);
2894 
2895  bk_stack_add_int_attr(psiEvent,"x",(long)event->xcrossing.x);
2896  bk_stack_add_int_attr(psiEvent,"y",(long)event->xcrossing.y);
2897 
2898  bk_stack_add_int_attr(psiEvent,"focus",(long)event->xcrossing.focus);
2899  bk_stack_add_int_attr(psiEvent,"state",(long)event->xcrossing.state);
2900 
2901  break;
2902 
2903 
2904  default:
2905  psiEvent->type = xmisc_event;
2906  bk_stack_add_int_attr(psiEvent,"event_type",(long)event->type);
2907  break;
2908  }
2909 
2910  return psiEvent;
2911 }
#define CR
Definition: xpred.c:25
ptr_definition xmisc_event
Definition: xpred.c:45
#define NULL
Definition: def_const.h:533
#define BS
Definition: xpred.c:26
ptr_definition xexpose_event
Definition: xpred.c:45
char * buffer
buffer used only in print.c - there is local with same name in xpred.c
Definition: def_glob.h:781
ptr_definition xconfigure_event
Definition: xpred.c:45
ptr_psi_term stack_psi_term(long stat)
stack_psi_term
Definition: lefun.c:21
ptr_definition xdestroy_event
Definition: xpred.c:45
ptr_definition xmotion_event
Definition: xpred.c:45
void bk_stack_add_int_attr(ptr_psi_term t, char *attrname, long value)
bk_stack_add_int_attr
Definition: xpred.c:206
ptr_definition xkeyboard_event
Definition: xpred.c:45
ptr_definition type
Definition: def_struct.h:181
ptr_definition xenter_event
Definition: xpred.c:45
ptr_definition xbutton_event
Definition: xpred.c:45
ptr_definition xleave_event
Definition: xpred.c:45
long xcFillArc ( )

xcFillArc

FillArc xcFillArc(+Connection,+Drawable,+X,+Y,+Width,+Height,+StartAngle,+ArcAngle, +Function,+Color) fill an arc.

Definition at line 2407 of file xpred.c.

References begin_builtin, DISP, DrawableGC, end_builtin, include_var_builtin, real, TRUE, WindowDisplayList, x_record_arc(), x_set_gc(), xDefaultFont, xDefaultLineWidth, and xdrawable.

2408 {
2409  include_var_builtin(10);
2410  ptr_definition types[10];
2411  long j;
2412  GC gc;
2413 
2414  for(j = 0; j < 10; j++)
2415  types[j] = real;
2416  types[1] = xdrawable;
2417 
2418  begin_builtin(xcFillArc,10,10,types);
2419 
2420  gc = DrawableGC(args[1]);
2421  x_set_gc((Display *)val[0],gc,val[8],val[9],xDefaultLineWidth,xDefaultFont);
2422 
2423  XFillArc(DISP(0),(Window) val[1],gc,/* Display,Window,GC */
2424  val[2],val[3],val[4],val[5], /* X,Y,Width,Height */
2425  val[6],val[7]); /* StartAngle,ArcAngle */
2426 
2427  x_record_arc((ListHeader *)WindowDisplayList(args[1]),FILL_ARC,
2428  val[2],val[3],val[4],val[5],
2429  val[6],val[7],val[8],val[9],
2431 
2432 XSync(DISP(0),0);
2433  success = TRUE;
2434 
2435  end_builtin();
2436 }
#define xDefaultLineWidth
Definition: def_const.h:944
void x_record_arc(ListHeader *displaylist, Action action, long x, long y, long width, long height, long startangle, long arcangle, unsigned long function, unsigned long color, unsigned long linewidth)
x_record_arc
Definition: xdisplaylist.c:221
ptr_definition xdrawable
Definition: xpred.c:45
#define WindowDisplayList(w)
Definition: xpred.c:146
long xcFillArc()
xcFillArc
Definition: xpred.c:2407
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void x_set_gc(Display *display, GC gc, long function, unsigned long color, long linewidth, Font font)
x_set_gc
Definition: xdisplaylist.c:142
#define DrawableGC(w)
Definition: xpred.c:145
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define xDefaultFont
Definition: def_const.h:943
#define DISP(X)
Definition: xpred.c:149
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcFillPolygon ( )

xcFillPolygon

FillPolygon xcFillPolygon(+Connection,+Drawable,+Points,+NbPoints,+Function,+Color) fill a polygon.

Definition at line 2558 of file xpred.c.

References begin_builtin, DISP, DrawableGC, end_builtin, include_var_builtin, real, TRUE, WindowDisplayList, x_record_polygon(), x_set_gc(), xDefaultFont, xDefaultLineWidth, and xdrawable.

2559 {
2561  ptr_definition types[6];
2562  long j;
2563  GC gc;
2564 
2565  for(j = 0; j < 6; j++)
2566  types[j] = real;
2567  types[1] = xdrawable;
2568 
2569  begin_builtin(xcFillPolygon,6,6,types);
2570 
2571  gc = DrawableGC(args[1]);
2572  x_set_gc((Display *)val[0],gc,val[4],val[5],xDefaultLineWidth,xDefaultFont);
2573 
2574  XFillPolygon(DISP(0),(Window) val[1],gc,/* Display,Window,GC */
2575  (XPoint *)val[2],val[3], /* Points,NbPoints */
2576  Complex,CoordModeOrigin); /* shape,mode */
2577 
2578  x_record_polygon((ListHeader *)WindowDisplayList(args[1]),FILL_POLYGON,
2579  (XPoint *)val[2],val[3],val[4],val[5],
2581 
2582  XSync(DISP(0),0);
2583  success = TRUE;
2584 
2585  end_builtin();
2586 }
#define xDefaultLineWidth
Definition: def_const.h:944
ptr_definition xdrawable
Definition: xpred.c:45
#define WindowDisplayList(w)
Definition: xpred.c:146
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void x_record_polygon(ListHeader *displaylist, Action action, XPoint *points, long npoints, unsigned long function, unsigned long color, unsigned long linewidth)
x_record_polygon
Definition: xdisplaylist.c:285
void x_set_gc(Display *display, GC gc, long function, unsigned long color, long linewidth, Font font)
x_set_gc
Definition: xdisplaylist.c:142
#define DrawableGC(w)
Definition: xpred.c:145
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define xDefaultFont
Definition: def_const.h:943
long xcFillPolygon()
xcFillPolygon
Definition: xpred.c:2558
#define DISP(X)
Definition: xpred.c:149
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcFillRectangle ( )

xcFillRectangle

FillRectangle xcFillRectangle(+Connection,+Drawable,+X,+Y,+Width,+Height, +Function,+Color) fill a rectangle.

Definition at line 2368 of file xpred.c.

References begin_builtin, DISP, DrawableGC, end_builtin, include_var_builtin, real, TRUE, WindowDisplayList, x_record_rectangle(), x_set_gc(), xDefaultFont, xDefaultLineWidth, and xdrawable.

2369 {
2371  ptr_definition types[8];
2372  long j;
2373  GC gc;
2374 
2375  for(j = 0; j < 8; j++)
2376  types[j] = real;
2377  types[1] = xdrawable;
2378 
2379  begin_builtin(xcFillRectangle,8,8,types);
2380 
2381  gc = DrawableGC(args[1]);
2382  x_set_gc((Display *)val[0],gc,val[6],val[7],xDefaultLineWidth,xDefaultFont);
2383 
2384  XFillRectangle(DISP(0),(Window) val[1],gc,/* Display,Window,GC */
2385  val[2],val[3],val[4],val[5]); /* X,Y,Width,Height */
2386 
2387  x_record_rectangle((ListHeader *)WindowDisplayList(args[1]),FILL_RECTANGLE,
2388  val[2],val[3],val[4],val[5],
2389  val[6],val[7],
2391 
2392 XSync(DISP(0),0);
2393  success = TRUE;
2394 
2395  end_builtin();
2396 }
#define xDefaultLineWidth
Definition: def_const.h:944
void x_record_rectangle(ListHeader *displaylist, Action action, long x, long y, long width, long height, unsigned long function, unsigned long color, unsigned long linewidth)
x_record_rectangle
Definition: xdisplaylist.c:255
ptr_definition xdrawable
Definition: xpred.c:45
#define WindowDisplayList(w)
Definition: xpred.c:146
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void x_set_gc(Display *display, GC gc, long function, unsigned long color, long linewidth, Font font)
x_set_gc
Definition: xdisplaylist.c:142
#define DrawableGC(w)
Definition: xpred.c:145
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define xDefaultFont
Definition: def_const.h:943
#define DISP(X)
Definition: xpred.c:149
long xcFillRectangle()
xcFillRectangle
Definition: xpred.c:2368
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcFlushEvents ( )

xcFlushEvents

FlushEvents xcFlushEvents(+Display,+Window,+Mask) flush all residuated events matching(display,window,mask).

Definition at line 3242 of file xpred.c.

References begin_builtin, DISP, wl_EventClosure::display, end_builtin, include_var_builtin, map_funct_over_list(), wl_EventClosure::mask, real, TRUE, wl_EventClosure::window, x_flush_event(), and xwindow.

3243 {
3245  ptr_definition types[3];
3246  EventClosure eventClosure;
3247 
3248  types[0] = real;
3249  types[1] = xwindow;
3250  types[2] = real;
3251 
3252  begin_builtin(xcFlushEvents,3,3,types);
3253 
3254  eventClosure.display =DISP(0);
3255  eventClosure.window = val[1];
3256  eventClosure.mask = val[2];
3257  map_funct_over_list(xevent_list,x_flush_event,(long *)&eventClosure);
3258 
3259  success = TRUE;
3260 
3261  end_builtin();
3262 }
Display * display
Definition: xpred.c:32
static long x_flush_event(ptr_psi_term eventElt, EventClosure *closure)
x_flush_event
Definition: xpred.c:3215
ptr_psi_term xevent_list
Definition: xpred.c:43
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
ptr_definition xwindow
Definition: xpred.c:45
#define TRUE
Standard boolean.
Definition: def_const.h:268
long map_funct_over_list(ptr_psi_term lst, long(*proc)(), long *closure)
map_funct_over_list
Definition: xpred.c:3056
#define DISP(X)
Definition: xpred.c:149
long mask
Definition: xpred.c:34
long xcFlushEvents()
xcFlushEvents
Definition: xpred.c:3242
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
Window window
Definition: xpred.c:33
long xcFreeColor ( )

xcFreeColor

FREECOLOR xcFreeColor(+Connection,+ColorMap,+Pixel) free the color in the colormap

Definition at line 2225 of file xpred.c.

References begin_builtin, CMAP, DISP, end_builtin, include_var_builtin, real, and TRUE.

2226 {
2228  ptr_definition types[3];
2229  long j;
2230  unsigned long pixel;
2231 
2232  for(j=0; j<3; j++)
2233  types[j] = real;
2234 
2235  begin_builtin(xcFreeColor,3,3,types);
2236 
2237  pixel = val[2];
2238  XFreeColors(DISP(0),CMAP(1),&pixel,1,0);
2239  success = TRUE;
2240 
2241  end_builtin();
2242 }
#define CMAP(X)
Definition: xpred.c:154
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
long xcFreeColor()
xcFreeColor
Definition: xpred.c:2225
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define DISP(X)
Definition: xpred.c:149
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcGetConnectionAttribute ( )

xcGetConnectionAttribute

long xcQueryTextExtents(); xcGetConnectionAttribute xcGetConnectionAttribute(+Display,+AttributeId,-Value) returns the value corresponding to the attribute id.

Definition at line 641 of file xpred.c.

References begin_builtin, DISP, DRAW, end_builtin, Errorline(), FALSE, GetConnectionAttribute(), include_var_builtin, REAL, real, TRUE, and unify_real_result().

642 {
644  ptr_definition types[3];
645  long attr;
646 
647  types[0] = real;
648  types[1] = real;
649  types[2] = real;
650 
652 
653  if(GetConnectionAttribute(DISP(0),DRAW(1),&attr))
654  {
655  unify_real_result(args[2],(REAL) attr);
656  success = TRUE;
657  }
658  else
659  {
660  Errorline("could not get connection attribute in %P.\n",g);
661  success = FALSE;
662  }
663 
664  end_builtin();
665 }
#define DRAW(X)
Definition: xpred.c:150
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
Definition: def_const.h:132
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
#define DISP(X)
Definition: xpred.c:149
long xcGetConnectionAttribute()
xcGetConnectionAttribute
Definition: xpred.c:641
long unify_real_result(ptr_psi_term t, REAL v)
unify_real_result
Definition: built_ins.c:386
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
static long GetConnectionAttribute(Display *display, long attributeId, long *attribute)
GetConnectionAttribute.
Definition: xpred.c:560
long xcGetEvent ( )

xcGetEvent

GetEvent xcGetEvent(+Display,+Window,+Mask) return an event matching the mask in the window. if no event residuate the call else return a null event.

Definition at line 3146 of file xpred.c.

References aim, append_to_list(), wl_goal::bbbb_1, begin_builtin, bk_stack_add_int_attr(), DISP, wl_EventClosure::display, end_builtin, GetPsiAttr(), include_var_builtin, map_funct_over_cars(), wl_EventClosure::mask, NULL, psi_term_ptr, push_goal(), push_ptr_value_global(), real, residuate(), stack_psi_term(), TRUE, unify, warningline(), WIND, wl_EventClosure::window, x_union_event(), and xwindow.

3147 {
3149  ptr_definition types[3];
3150  XEvent event;
3151  ptr_psi_term psiEvent;
3152  ptr_psi_term eventElt;
3153  EventClosure eventClosure;
3154  ptr_psi_term result;
3155 
3156  types[0] = real;
3157  types[1] = xwindow;
3158  types[2] = real;
3159 
3160  result=aim->bbbb_1;
3161 
3162  begin_builtin(xcGetEvent,3,3,types);
3163 
3164  if(!xevent_existing) {
3165 
3166  /* warning if a same event is already waiting */
3167  eventClosure.display =DISP(0);
3168  eventClosure.window =WIND(1);
3169  eventClosure.mask = val[2];
3170  if(!map_funct_over_cars(xevent_list,x_union_event,(long *)&eventClosure))
3171  warningline("you have coinciding event handlers on the same window");
3172 
3173  /* transform the request into a psi-term */
3174  eventElt = stack_psi_term(4);
3175  bk_stack_add_int_attr(eventElt,"display",(long)val[0]);
3176  bk_stack_add_int_attr(eventElt,"window",(long)val[1]);
3177  bk_stack_add_int_attr(eventElt,"mask",(long)val[2]);
3178 
3179  /* stack_insert(FEATURECMP,"event",&(eventElt->attr_list),(GENERIC)result); */
3180 
3181  /* add the request in the list of waiting events */
3182  append_to_list(xevent_list,eventElt); /* RM: Dec 15 1992 */
3183 
3184  /* residuate the call */
3185  residuate(eventElt); /* RM: May 5 1993 */
3186 
3187  /* return a psi-term containing an `empty' event */
3188  /* psiEvent = stack_psi_term(4);
3189  psiEvent->type = xevent; RM: May 5 1993 */
3190  }
3191  else {
3192  /* get the event built by x_exist_event */
3193  psiEvent = GetPsiAttr(xevent_existing,"event");
3196  push_goal(unify,psiEvent,aim->bbbb_1,NULL); /* RM: May 5 1993 */
3197  }
3198 
3199  /* push_goal(unify,psiEvent,aim->bbbb_1,NULL); RM: May 5 1993 */
3200 
3201  success = TRUE;
3202 
3203  end_builtin();
3204 }
Display * display
Definition: xpred.c:32
void residuate(ptr_psi_term t)
residuate
Definition: lefun.c:125
void push_goal(goals t, ptr_psi_term a, ptr_psi_term b, GENERIC c)
push_goal
Definition: login.c:600
long xcGetEvent()
xcGetEvent
Definition: xpred.c:3146
void push_ptr_value_global(type_ptr t, GENERIC *p)
push_ptr_value_global
Definition: login.c:523
ptr_psi_term xevent_list
Definition: xpred.c:43
static long x_union_event(ptr_psi_term psiEvent, EventClosure *closure)
x_union_event
Definition: xpred.c:3130
#define NULL
Definition: def_const.h:533
ptr_psi_term GetPsiAttr(ptr_psi_term psiTerm, char *attributeName)
GetPsiAttr.
Definition: xpred.c:367
ptr_psi_term append_to_list(ptr_psi_term lst, ptr_psi_term value)
append_to_list
Definition: xpred.c:3035
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
unsigned long * GENERIC
unsigned long *GENERIC
Definition: def_struct.h:35
ptr_definition xwindow
Definition: xpred.c:45
#define TRUE
Standard boolean.
Definition: def_const.h:268
ptr_psi_term stack_psi_term(long stat)
stack_psi_term
Definition: lefun.c:21
long map_funct_over_cars(ptr_psi_term lst, long(*proc)(), long *closure)
map_funct_over_cars
Definition: xpred.c:3078
ptr_goal aim
Definition: def_glob.h:1024
#define unify
was enum (goal) – but must be long for error.c - now typedef
Definition: def_const.h:1058
#define DISP(X)
Definition: xpred.c:149
void bk_stack_add_int_attr(ptr_psi_term t, char *attrname, long value)
bk_stack_add_int_attr
Definition: xpred.c:206
long mask
Definition: xpred.c:34
ptr_psi_term xevent_existing
Definition: xpred.c:42
void warningline(char *format,...)
warningline
Definition: error.c:371
ptr_psi_term bbbb_1
Definition: def_struct.h:240
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define WIND(X)
Definition: xpred.c:151
#define end_builtin()
Definition: def_macro.h:259
Window window
Definition: xpred.c:33
#define psi_term_ptr
values of type_ptr
Definition: def_const.h:383
long xcGetGCAttribute ( )

xcGetGCAttribute

GETGCATTRIBUTE xcGetGCAttribute(+GC,+AttributeId,-Val) get the value of the attribute id of GC.

Definition at line 1942 of file xpred.c.

References begin_builtin, DISP, end_builtin, Errorline(), FALSE, GCVAL, GetGCAttribute(), include_var_builtin, REAL, real, TRUE, and unify_real_result().

1943 {
1945  ptr_definition types[3];
1946  long attr;
1947 
1948  types[0] = real;
1949  types[1] = real;
1950  types[2] = real;
1951 
1952  begin_builtin(xcGetGCAttribute,3,2,types);
1953 
1954  if(GetGCAttribute((GC)DISP(0),(long)GCVAL(1),&attr))
1955  {
1956  unify_real_result(args[2],(REAL) attr);
1957  success = TRUE;
1958  }
1959  else
1960  {
1961  Errorline("could not get gc attribute in %P.\n",g);
1962  success = FALSE;
1963  }
1964 
1965  end_builtin();
1966 }
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
Definition: def_const.h:132
static long GetGCAttribute(GC gc, long attributeId, long *attribute)
GetGCAttribute.
Definition: xpred.c:1846
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
#define GCVAL(X)
Definition: xpred.c:152
#define DISP(X)
Definition: xpred.c:149
long xcGetGCAttribute()
xcGetGCAttribute
Definition: xpred.c:1942
long unify_real_result(ptr_psi_term t, REAL v)
unify_real_result
Definition: built_ins.c:386
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcGetScreenAttribute ( )

xcGetScreenAttribute

xcGetScreenAttribute xcGetScreenAttribute(+Display,+Screen,+AttributeId,-Value) returns the value corresponding to the attribute id.

Definition at line 752 of file xpred.c.

References begin_builtin, DISP, DRAW, end_builtin, Errorline(), FALSE, GetScreenAttribute(), include_var_builtin, REAL, real, TRUE, and unify_real_result().

753 {
755  ptr_definition types[4];
756  long attr;
757 
758  types[0] = real;
759  types[1] = real;
760  types[2] = real;
761  types[3] = real;
762 
764 
765  if(GetScreenAttribute(DISP(0),DRAW(1),val[2],&attr))
766  {
767  unify_real_result(args[3],(REAL) attr);
768  success = TRUE;
769  }
770  else
771  {
772  Errorline("could not get screen attribute in %P.\n",g);
773  success = FALSE;
774  }
775 
776  end_builtin();
777 }
#define DRAW(X)
Definition: xpred.c:150
long xcGetScreenAttribute()
xcGetScreenAttribute
Definition: xpred.c:752
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
Definition: def_const.h:132
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
static long GetScreenAttribute(Display *display, long screen, long attributeId, long *attribute)
GetScreenAttribute.
Definition: xpred.c:677
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
#define DISP(X)
Definition: xpred.c:149
long unify_real_result(ptr_psi_term t, REAL v)
unify_real_result
Definition: built_ins.c:386
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcGetWindowAttribute ( )

xcGetWindowAttribute

xcGetWindowAttribute xcGetWindowAttribute(+Display,+Window,+AttributeId,-Value) returns the value corresponding to the attribute id of the window.

Definition at line 1221 of file xpred.c.

References begin_builtin, DISP, end_builtin, Errorline(), FALSE, GetWindowAttribute(), include_var_builtin, REAL, real, TRUE, unify_real_result(), WIND, and xwindow.

1222 {
1224  ptr_definition types[4];
1225  long attr;
1226 
1227 
1228  types[0] = real;
1229  types[1] = xwindow;
1230  types[2] = real;
1231  types[3] = real;
1232 
1234 
1235  if(GetWindowAttribute(DISP(0),WIND(1),val[2],&attr))
1236  {
1237  unify_real_result(args[3],(REAL) attr);
1238  success = TRUE;
1239  }
1240  else
1241  {
1242  Errorline("could not get a window attribute in %P.\n",g);
1243  success = FALSE;
1244  }
1245 
1246  end_builtin();
1247 }
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
Definition: def_const.h:132
static long GetWindowAttribute(Display *display, long window, long attributeId, long *attribute)
GetWindowAttribute.
Definition: xpred.c:1129
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
long xcGetWindowAttribute()
xcGetWindowAttribute
Definition: xpred.c:1221
ptr_definition xwindow
Definition: xpred.c:45
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
#define DISP(X)
Definition: xpred.c:149
long unify_real_result(ptr_psi_term t, REAL v)
unify_real_result
Definition: built_ins.c:386
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define WIND(X)
Definition: xpred.c:151
#define end_builtin()
Definition: def_macro.h:259
long xcGetWindowGeometry ( )

xcGetWindowGeometry

xcGetWindowGeometry xcGetWindowGeometry(+Display,+Window,-X,-Y,-Width,-Height) returns the geometry of the window.

Definition at line 1087 of file xpred.c.

References begin_builtin, DISP, DRAW, end_builtin, Errorline(), FALSE, include_var_builtin, REAL, real, TRUE, unify_real_result(), and xdrawable.

1088 {
1090  ptr_definition types[6];
1091  int j,x,y;
1092  unsigned int w,h,bw,d;
1093  Window r;
1094 
1095  for(j=0; j<6; j++)
1096  types[j] = real;
1097  types[1] = xdrawable;
1098 
1100 
1101  if(XGetGeometry(DISP(0),DRAW(1),
1102  &r,&x,&y,&w,&h,&bw,&d))
1103  {
1104  unify_real_result(args[2],(REAL) x);
1105  unify_real_result(args[3],(REAL) y);
1106  unify_real_result(args[4],(REAL) w);
1107  unify_real_result(args[5],(REAL) h);
1108  success = TRUE;
1109  }
1110  else
1111  {
1112  Errorline("could not get the geometry in %P.\n",g);
1113  success = FALSE;
1114  }
1115 
1116  end_builtin();
1117 }
long xcGetWindowGeometry()
xcGetWindowGeometry
Definition: xpred.c:1087
#define DRAW(X)
Definition: xpred.c:150
ptr_definition xdrawable
Definition: xpred.c:45
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
Definition: def_const.h:132
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
#define DISP(X)
Definition: xpred.c:149
long unify_real_result(ptr_psi_term t, REAL v)
unify_real_result
Definition: built_ins.c:386
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcLoadFont ( )

xcLoadFont

LoadFont xcLoadFont(+Connection,+Name,-Font) load a font.

Definition at line 2596 of file xpred.c.

References begin_builtin, DISP, end_builtin, Errorline(), FALSE, include_var_builtin, quoted_string, REAL, real, STRG, TRUE, and unify_real_result().

2597 {
2599  ptr_definition types[3];
2600  Font font;
2601 
2602  types[0] = real;
2603  types[1] = quoted_string;
2604  types[2] = real;
2605 
2606  begin_builtin(xcLoadFont,3,2,types);
2607 
2608  if(font=XLoadFont(DISP(0),STRG(1)))
2609  {
2610  unify_real_result(args[2],(REAL) font);
2611  XSync(DISP(0),0);
2612  success = TRUE;
2613  }
2614  else
2615  {
2616  Errorline("could not load a font in %P.\n",g);
2617  success = FALSE;
2618  }
2619 
2620  end_builtin();
2621 }
#define STRG(X)
Definition: xpred.c:155
long xcLoadFont()
xcLoadFont
Definition: xpred.c:2596
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
Definition: def_const.h:132
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
#define DISP(X)
Definition: xpred.c:149
long unify_real_result(ptr_psi_term t, REAL v)
unify_real_result
Definition: built_ins.c:386
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
ptr_definition quoted_string
symbol in bi module
Definition: def_glob.h:368
long xcMapSubwindows ( )

xcMapSubwindows

xcMapSubwindows xcMapSubwindows(+Connection,+Window) map the sub-windows on the display Connection.

Definition at line 1577 of file xpred.c.

References begin_builtin, DISP, end_builtin, hide_subwindow, include_var_builtin, push_window(), real, TRUE, and WIND.

1578 {
1580  ptr_definition types[2];
1581 
1582  types[0] = real;
1583  types[1] = real;
1584 
1585  begin_builtin(xcMapSubwindow,2,2,types);
1586 
1587  XMapSubwindows(DISP(0),WIND(1));
1588  XSync(DISP(0),0);
1589 
1590  push_window(hide_subwindow,(long)DISP(0),WIND(1));
1591  success = TRUE;
1592 
1593  end_builtin();
1594 }
#define hide_subwindow
To backtrack on hide sub windows RM 8/12/92.
Definition: def_const.h:477
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define DISP(X)
Definition: xpred.c:149
void push_window(long type, long disp, long wind)
push_window
Definition: login.c:548
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define WIND(X)
Definition: xpred.c:151
#define end_builtin()
Definition: def_macro.h:259
long xcMapWindow ( )

xcMapWindow

xcMapWindow xcMapWindow(+Connection,+Window) map the Window on the display Connection.

Definition at line 1494 of file xpred.c.

References begin_builtin, DISP, end_builtin, hide_window, include_var_builtin, push_window(), real, TRUE, and WIND.

1496 {
1498  ptr_definition types[2];
1499 
1500  types[0] = real;
1501  types[1] = real;
1502 
1503  begin_builtin(xcMapWindow,2,2,types);
1504 
1505  XMapWindow(DISP(0),WIND(1));
1506  XSync(DISP(0),0);
1507 
1508  push_window(hide_window,(long)DISP(0),val[1]);
1509  success = TRUE;
1510 
1511  end_builtin();
1512 }
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
long xcMapWindow()
xcMapWindow
Definition: xpred.c:1494
#define hide_window
To backtrack on hide window.
Definition: def_const.h:463
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define DISP(X)
Definition: xpred.c:149
void push_window(long type, long disp, long wind)
push_window
Definition: login.c:548
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define WIND(X)
Definition: xpred.c:151
#define end_builtin()
Definition: def_macro.h:259
long xcMoveWindow ( )

xcMoveWindow

xcMoveWindow xcMoveWindow(+Display,+Window,+X,+Y) Move a window to a different location.

Definition at line 1288 of file xpred.c.

References begin_builtin, DISP, DRAW, end_builtin, include_var_builtin, real, TRUE, and xdrawable.

1289 {
1291  ptr_definition types[4];
1292  long j;
1293 
1294  for(j=0; j<4; j++)
1295  types[j] = real;
1296  types[1] = xdrawable;
1297 
1298  begin_builtin(xcMoveWindow,4,4,types);
1299 
1300  XMoveWindow(DISP(0),DRAW(1), val[2],val[3]);
1301 
1302  success = TRUE;
1303 
1304  end_builtin();
1305 }
long xcMoveWindow()
xcMoveWindow
Definition: xpred.c:1288
#define DRAW(X)
Definition: xpred.c:150
ptr_definition xdrawable
Definition: xpred.c:45
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define DISP(X)
Definition: xpred.c:149
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcOpenConnection ( )

xcOpenConnection

xcOpenConnection xcOpenConnection(+Name,-Connection) open a connection to the X server.

Definition at line 485 of file xpred.c.

References begin_builtin, end_builtin, Errorline(), FALSE, include_var_builtin, NewPsi(), NULL, push_goal(), quoted_string, STRG, TRUE, unify, and xdisplay.

486 {
488  ptr_definition types[2];
489  char *display;
490  Display * connection;
491  ptr_psi_term psiConnection;
492 
493 
494  types[0] = quoted_string;
495  types[1] = xdisplay;
496 
497 
498  begin_builtin(xcOpenConnection,2,1,types);
499 
500  if(strcmp(STRG(0),""))
501  display =STRG(0);
502  else
503  display = NULL;
504 
505  if(connection = XOpenDisplay(display))
506  {
507  psiConnection = NewPsi(xdisplay,"id",(long)connection); // add cast DJD
508  push_goal(unify,psiConnection,args[1],NULL);
509 
510  success = TRUE;
511  }
512  else
513  {
514  Errorline("could not open connection in %P.\n",g);
515  success = FALSE;
516  }
517 
518  end_builtin();
519 }
#define STRG(X)
Definition: xpred.c:155
void push_goal(goals t, ptr_psi_term a, ptr_psi_term b, GENERIC c)
push_goal
Definition: login.c:600
ptr_definition xdisplay
Definition: xpred.c:45
#define NULL
Definition: def_const.h:533
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
long xcOpenConnection()
xcOpenConnection
Definition: xpred.c:485
#define unify
was enum (goal) – but must be long for error.c - now typedef
Definition: def_const.h:1058
static ptr_psi_term NewPsi(ptr_definition t, char *f, long v)
ptr_psi_term NewPsi
Definition: xpred.c:314
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
ptr_definition quoted_string
symbol in bi module
Definition: def_glob.h:368
long xcPointsAlloc ( )

xcPointsAlloc

PointsAlloc xcPointsAlloc(+NbPoints,-Points) allocate n points

Definition at line 2445 of file xpred.c.

References begin_builtin, end_builtin, include_var_builtin, REAL, real, TRUE, and unify_real_result().

2446 {
2448  ptr_definition types[2];
2449  long Points;
2450 
2451  types[0] = real;
2452  types[1] = real;
2453 
2454  begin_builtin(xcPointsAlloc,2,1,types);
2455  Points =(long) malloc((val [0]) * 2 * sizeof(short));
2456  unify_real_result(args[1],(REAL) Points);
2457 
2458  success = TRUE;
2459 
2460  end_builtin();
2461 }
long xcPointsAlloc()
xcPointsAlloc
Definition: xpred.c:2445
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
Definition: def_const.h:132
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
#define TRUE
Standard boolean.
Definition: def_const.h:268
long unify_real_result(ptr_psi_term t, REAL v)
unify_real_result
Definition: built_ins.c:386
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcPointsFree ( )

xcPointsFree

PointsFree xcPointsFree(+Points) free points

Definition at line 2500 of file xpred.c.

References begin_builtin, end_builtin, include_var_builtin, real, and TRUE.

2501 {
2503  ptr_definition types[1];
2504 
2505  types[0] = real;
2506 
2507  begin_builtin(xcPointsFree,1,1,types);
2508  free((void *)val [0]);
2509  success = TRUE;
2510 
2511  end_builtin();
2512 }
long xcPointsFree()
xcPointsFree
Definition: xpred.c:2500
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcPostScriptWindow ( )

xcPostScriptWindow

xcPostScriptWindow xcPostScriptWindow(+Display,+Window,Filename) output the contents of the window in Filename

Definition at line 1749 of file xpred.c.

References begin_builtin, end_builtin, GetIntAttr(), GetPsiAttr(), include_var_builtin, quoted_string, real, x_postscript_window(), and xwindow.

1750 {
1752  ptr_definition types[3];
1753 
1754  types[0] = real;
1755  types[1] = xwindow;
1756  types[2] = quoted_string;
1757 
1758  begin_builtin(xcPostScriptWindow,3,3,types);
1759 
1760  success = x_postscript_window((Display *) val[0],val[1],(ListHeader *)GetIntAttr(GetPsiAttr(args[1],"display_list"),"id"),(char *)val[2]);
1761 
1762  end_builtin();
1763 }
long x_postscript_window(Display *display, Window window, ListHeader *displaylist, char *filename)
x_postscript_window
Definition: xdisplaylist.c:839
ptr_psi_term GetPsiAttr(ptr_psi_term psiTerm, char *attributeName)
GetPsiAttr.
Definition: xpred.c:367
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
ptr_definition xwindow
Definition: xpred.c:45
long xcPostScriptWindow()
xcPostScriptWindow
Definition: xpred.c:1749
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long GetIntAttr(ptr_psi_term psiTerm, char *attributeName)
GetIntAttr.
Definition: xpred.c:333
ptr_definition quoted_string
symbol in bi module
Definition: def_glob.h:368
long xcQueryPointer ( )

xcQueryPointer

xcQueryPointer xcQueryPointer(+Display,+Window, -root_return, -child_return, -root_x_return,-root_y_return, -win_x_return, -win_y_return, -mask_return, -same_screen)

this predicate returns a psi-term containing loads of info about where the pointer is at. See 'XQueryPointer' for a complete definition(the boolean result of XQueryPointer is stored as 'same_screen'.

Definition at line 3322 of file xpred.c.

References begin_builtin, DISP, end_builtin, include_var_builtin, REAL, real, TRUE, unify_real_result(), WIND, and xdrawable.

3323 {
3324  include_var_builtin(10);
3325  ptr_definition types[10];
3326  Window root_return,child_return;
3327  int root_x_return,root_y_return;
3328  int win_x_return,win_y_return;
3329  unsigned int mask_return;
3330  long same_screen;
3331  long j;
3332 
3333  for(j=0; j<10; j++)
3334  types[j] = real;
3335 
3336  types[1] = xdrawable;
3337 
3338  begin_builtin(xcQueryPointer,10,2,types);
3339 
3340 
3341  same_screen=XQueryPointer(DISP(0),
3342  WIND(1),
3343  &root_return, &child_return,
3344  &root_x_return,&root_y_return,
3345  &win_x_return, &win_y_return,
3346  &mask_return);
3347 
3348 
3349  unify_real_result(args[2],(REAL)root_return);
3350  unify_real_result(args[3],(REAL)child_return);
3351  unify_real_result(args[4],(REAL)root_x_return);
3352  unify_real_result(args[5],(REAL)root_y_return);
3353  unify_real_result(args[6],(REAL)win_x_return);
3354  unify_real_result(args[7],(REAL)win_y_return);
3355  unify_real_result(args[8],(REAL)mask_return);
3356  unify_real_result(args[9],(REAL)same_screen);
3357 
3358  /* printf("root: %ld\nchild: %ld\n",root_return,child_return); */
3359 
3360  success = TRUE;
3361 
3362  end_builtin();
3363 }
ptr_definition xdrawable
Definition: xpred.c:45
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
Definition: def_const.h:132
long xcQueryPointer()
xcQueryPointer
Definition: xpred.c:3322
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define DISP(X)
Definition: xpred.c:149
long unify_real_result(ptr_psi_term t, REAL v)
unify_real_result
Definition: built_ins.c:386
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define WIND(X)
Definition: xpred.c:151
#define end_builtin()
Definition: def_macro.h:259
long xcQueryTextExtents ( )

xcQueryTextExtents

xcQueryTextExtents(display,font,string, direction,font-ascent,font-descent, left-bearing,right-bearing,width,ascent,descent)

Definition at line 3933 of file xpred.c.

References begin_builtin, DISP, end_builtin, include_var_builtin, quoted_string, REAL, real, STRG, unify_real_result(), and xcLoadFont().

3934 {
3935  include_var_builtin(11);
3936  ptr_definition types[11];
3937  Font font;
3938  XCharStruct over;
3939  int i;
3940  int direction,ascent,descent; /* RM: 28 Jan 94 */
3941 
3942  types[0] = real; /* +Display */
3943  types[1] = real; /* +Font ID */
3944  types[2] = quoted_string; /* +String */
3945  types[3] = real; /* -Direction */
3946  types[4] = real; /* -Font-ascent */
3947  types[5] = real; /* -Font-descent */
3948  types[6] = real; /* -left bearing */
3949  types[7] = real; /* -right bearing */
3950  types[8] = real; /* -width */
3951  types[9] = real; /* -ascent */
3952  types[10]= real; /* -descent */
3953 
3954 
3955 
3956  begin_builtin(xcLoadFont,11,3,types);
3957 
3958 
3959  XQueryTextExtents(DISP(0),
3960  (XID)val[1],
3961  STRG(2),
3962  strlen(STRG(2)),
3963  &direction,
3964  &ascent,
3965  &descent,
3966  &over);
3967 
3968  val[3]=direction;
3969  val[4]=ascent;
3970  val[5]=descent;
3971 
3972  val[6] =over.lbearing;
3973  val[7] =over.rbearing;
3974  val[8] =over.width;
3975  val[9] =over.ascent;
3976  val[10]=over.descent;
3977 
3978  for(i=3;i<11;i++)
3979  unify_real_result(args[i],(REAL)val[i]);
3980 
3981  end_builtin();
3982 }
#define STRG(X)
Definition: xpred.c:155
long xcLoadFont()
xcLoadFont
Definition: xpred.c:2596
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
Definition: def_const.h:132
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
#define DISP(X)
Definition: xpred.c:149
long unify_real_result(ptr_psi_term t, REAL v)
unify_real_result
Definition: built_ins.c:386
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
ptr_definition quoted_string
symbol in bi module
Definition: def_glob.h:368
long xcRaiseWindow ( )

xcRaiseWindow

xcRaiseWindow xcRaiseWindow(+Connection,+Window) raise the Window on the display Connection.

Definition at line 1522 of file xpred.c.

References begin_builtin, DISP, end_builtin, hide_window, include_var_builtin, push_window(), real, TRUE, and WIND.

1523 {
1525  ptr_definition types[2];
1526 
1527  types[0] = real;
1528  types[1] = real;
1529 
1530  begin_builtin(xcRaiseWindow,2,2,types);
1531 
1532  XRaiseWindow(DISP(0),WIND(1));
1533  XSync(DISP(0),0);
1534 
1535  push_window(hide_window,(long)DISP(0),WIND(1));
1536  success = TRUE;
1537 
1538  end_builtin();
1539 }
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
#define hide_window
To backtrack on hide window.
Definition: def_const.h:463
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define DISP(X)
Definition: xpred.c:149
void push_window(long type, long disp, long wind)
push_window
Definition: login.c:548
long xcRaiseWindow()
xcRaiseWindow
Definition: xpred.c:1522
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define WIND(X)
Definition: xpred.c:151
#define end_builtin()
Definition: def_macro.h:259
long xcRefreshWindow ( )

xcRefreshWindow

xcRefreshWindow xcRefreshWindow(+Connection,+Window) refresh the window

Definition at line 1714 of file xpred.c.

References begin_builtin, DrawableGC, end_builtin, GetIntAttr(), GetPsiAttr(), include_var_builtin, real, TRUE, WindowDisplayList, x_refresh_window(), and xwindow.

1715 {
1717  ptr_definition types[2];
1718  Pixmap pixmap;
1719  ptr_psi_term psiPixmap;
1720 
1721  types[0] = real;
1722  types[1] = xwindow;
1723 
1724  begin_builtin(xcRefreshWindow,2,2,types);
1725 
1726  psiPixmap = GetPsiAttr(args[1],"pixmap");
1727  if((pixmap =(Pixmap) GetIntAttr(psiPixmap,"id")) != 0)
1728  x_refresh_window((Display *)val[0],val[1],pixmap,
1729  DrawableGC(psiPixmap),
1730  (ListHeader *)WindowDisplayList(args[1]));
1731  else
1732  x_refresh_window((Display *)val[0],val[1],val[1],
1733  DrawableGC(args[1]),
1734  (ListHeader *)WindowDisplayList(args[1]));
1735 
1736  success = TRUE;
1737 
1738  end_builtin();
1739 }
long xcRefreshWindow()
xcRefreshWindow
Definition: xpred.c:1714
#define WindowDisplayList(w)
Definition: xpred.c:146
ptr_psi_term GetPsiAttr(ptr_psi_term psiTerm, char *attributeName)
GetPsiAttr.
Definition: xpred.c:367
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
ptr_definition xwindow
Definition: xpred.c:45
#define DrawableGC(w)
Definition: xpred.c:145
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long GetIntAttr(ptr_psi_term psiTerm, char *attributeName)
GetIntAttr.
Definition: xpred.c:333
void x_refresh_window(Display *display, Window window, Pixmap pixmap, GC pixmapgc, ListHeader *displaylist)
x_refresh_window
Definition: xdisplaylist.c:447
long xcRequestColor ( )

xcRequestColor

REQUESTCOLOR xcRequestColor(+Connection,+ColorMap,+Red,+Green,+Blue,-Pixel) get the closest color to(Red,Green,Blue) in the ColorMap

Definition at line 2150 of file xpred.c.

References begin_builtin, CMAP, DISP, end_builtin, Errorline(), FALSE, include_var_builtin, REAL, real, TRUE, and unify_real_result().

2151 {
2153  ptr_definition types[6];
2154  long j;
2155  XColor color;
2156 
2157  for(j=0; j<6; j++)
2158  types[j] = real;
2159 
2160  begin_builtin(xcRequestColor,6,5,types);
2161 
2162  color.red =(val[2]) << 8;
2163  color.green =(val[3]) << 8;
2164  color.blue =(val[4]) << 8;
2165  color.flags = DoRed|DoGreen|DoBlue;
2166 
2167  if(XAllocColor(DISP(0),CMAP(1),&color))
2168  {
2169  unify_real_result(args[5],(REAL) color.pixel);
2170  success = TRUE;
2171  }
2172  else
2173  {
2174  Errorline("could not request a color in %P.\n",g);
2175  success = FALSE;
2176  }
2177 
2178  end_builtin();
2179 }
#define CMAP(X)
Definition: xpred.c:154
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
Definition: def_const.h:132
long xcRequestColor()
xcRequestColor
Definition: xpred.c:2150
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
#define DISP(X)
Definition: xpred.c:149
long unify_real_result(ptr_psi_term t, REAL v)
unify_real_result
Definition: built_ins.c:386
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcRequestNamedColor ( )

xcRequestNamedColor

REQUESTNAMEDCOLOR xcRequestNamedColor(+Connection,+ColorMap,+Name,-Pixel) get the color corresponding to Name in the ColorMap

Definition at line 2189 of file xpred.c.

References begin_builtin, CMAP, DISP, end_builtin, Errorline(), FALSE, include_var_builtin, quoted_string, REAL, real, STRG, TRUE, and unify_real_result().

2190 {
2192  ptr_definition types[4];
2193  long j;
2194  XColor cell,rgb;
2195 
2196  types[0] = real;
2197  types[1] = real;
2198  types[2] = quoted_string;
2199  types[3] = real;
2200 
2202 
2203  if(XAllocNamedColor(DISP(0),CMAP(1),STRG(2),&cell,&rgb))
2204  {
2205  unify_real_result(args[3],(REAL) cell.pixel);
2206  success = TRUE;
2207  }
2208  else
2209  {
2210  Errorline("could not request a named color in %P.\n",g);
2211  success = FALSE;
2212  }
2213 
2214  end_builtin();
2215 }
#define STRG(X)
Definition: xpred.c:155
long xcRequestNamedColor()
xcRequestNamedColor
Definition: xpred.c:2189
#define CMAP(X)
Definition: xpred.c:154
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
Definition: def_const.h:132
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
#define DISP(X)
Definition: xpred.c:149
long unify_real_result(ptr_psi_term t, REAL v)
unify_real_result
Definition: built_ins.c:386
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
ptr_definition quoted_string
symbol in bi module
Definition: def_glob.h:368
long xcResizeWindowPixmap ( )

xcResizeWindowPixmap

xcResizeWindowPixmap xcResizeWindowPixmap(+Display,+Window,+Width,+Height) resize the pixmap of the window,useful when we caught the resize event eg: the window is resized manualy.

Definition at line 1661 of file xpred.c.

References begin_builtin, end_builtin, include_var_builtin, real, ResizePixmap(), TRUE, and xdrawable.

1662 {
1664  ptr_definition types[4];
1665  long j;
1666 
1667  for(j=0; j<4; j++)
1668  types[j] = real;
1669  types[1] = xdrawable;
1670 
1672 
1673  /* modify the pixmap */
1674  ResizePixmap(args[1],(Display *)val[0],val[1],val[2],val[3]);
1675 
1676  success = TRUE;
1677 
1678  end_builtin();
1679 }
ptr_definition xdrawable
Definition: xpred.c:45
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
#define TRUE
Standard boolean.
Definition: def_const.h:268
long xcResizeWindowPixmap()
xcResizeWindowPixmap
Definition: xpred.c:1661
static void ResizePixmap(ptr_psi_term psi_window, Display *display, Window window, unsigned long width, unsigned long height)
ResizePixmap.
Definition: xpred.c:400
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcSelectInput ( )

xcSelectInput

xcSelectInput xcSelectInput(+Connection,+Window,+Mask) select the desired event types

Definition at line 1689 of file xpred.c.

References begin_builtin, DISP, end_builtin, include_var_builtin, real, TRUE, and WIND.

1690 {
1692  ptr_definition types[3];
1693 
1694  types[0] = real;
1695  types[1] = real;
1696  types[2] = real;
1697 
1698  begin_builtin(xcSelectInput,3,3,types);
1699 
1700  XSelectInput(DISP(0),WIND(1),val[2]);
1701  success = TRUE;
1702 
1703  end_builtin();
1704 }
long xcSelectInput()
xcSelectInput
Definition: xpred.c:1689
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define DISP(X)
Definition: xpred.c:149
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define WIND(X)
Definition: xpred.c:151
#define end_builtin()
Definition: def_macro.h:259
long xcSetGCAttribute ( )

xcSetGCAttribute

SETGCATTRIBUTE xcSetGCAttribute(+Display,+GC,+AttributeId,+Val) set the value of the attribute id of GC.

Definition at line 2094 of file xpred.c.

References begin_builtin, DISP, end_builtin, Errorline(), FALSE, GCVAL, include_var_builtin, real, SetGCAttribute(), and TRUE.

2095 {
2097  ptr_definition types[4];
2098 
2099 
2100  types[0] = real;
2101  types[1] = real;
2102  types[2] = real;
2103  types[3] = real;
2104 
2105  begin_builtin(xcSetGCAttribute,4,4,types);
2106 
2107  if(SetGCAttribute((Display *)DISP(0),GCVAL(1),val[2],val[3]))
2108  success = TRUE;
2109  else
2110  {
2111  Errorline("could not set gc attribute in %P.\n",g);
2112  success = FALSE;
2113  }
2114 
2115  end_builtin();
2116 }
static long SetGCAttribute(Display *display, GC gc, long attributeId, long attribute)
SetGCAttribute.
Definition: xpred.c:1978
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
long xcSetGCAttribute()
xcSetGCAttribute
Definition: xpred.c:2094
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
#define GCVAL(X)
Definition: xpred.c:152
#define DISP(X)
Definition: xpred.c:149
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcSetStandardProperties ( )

xcSetStandardProperties

xcSetStandardProperties

xcSetStandardProperties(+Display,+Window,+WindowTitle,+IconTitle, +X,+Y,+Width,+Height)

Definition at line 1043 of file xpred.c.

References begin_builtin, DISP, end_builtin, include_var_builtin, NULL, quoted_string, real, ResizePixmap(), TRUE, WIND, and xwindow.

1044 {
1046  ptr_definition types[8];
1047  long j;
1048  XSizeHints hints;
1049 
1050 
1051  for(j=0; j<8; j++)
1052  types[j] = real;
1053  types[1] = xwindow;
1054  types[2] = quoted_string;
1055  types[3] = quoted_string;
1056 
1058 
1059  hints.x = val[4];
1060  hints.y = val[5];
1061  hints.width = val[6] ;
1062  hints.height = val[7];
1063  hints.flags = PPosition | PSize;
1064 
1065  XSetStandardProperties(DISP(0),WIND(1),
1066  (char*)val[2],(char*)val[3],/* window title,icon title */
1067  None, /* icon pixmap */
1068  (char **) NULL,0, /* argv,argc */
1069  &hints);
1070 
1071  ResizePixmap(args[1],(Display *)val[0],val[1],val[6],val[7]);
1072 
1073  success = TRUE;
1074 
1075  end_builtin();
1076 
1077 }
#define NULL
Definition: def_const.h:533
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
ptr_definition xwindow
Definition: xpred.c:45
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define DISP(X)
Definition: xpred.c:149
static void ResizePixmap(ptr_psi_term psi_window, Display *display, Window window, unsigned long width, unsigned long height)
ResizePixmap.
Definition: xpred.c:400
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define WIND(X)
Definition: xpred.c:151
#define end_builtin()
Definition: def_macro.h:259
ptr_definition quoted_string
symbol in bi module
Definition: def_glob.h:368
long xcSetStandardProperties()
xcSetStandardProperties
Definition: xpred.c:1043
long xcSetWindowAttribute ( )

xcSetWindowAttribute

xcSetWindowAttribute xcSetWindowAttribute(+Display,+Window,+AttributeId,+Value) set the value corresponding to the attribute id.

Definition at line 1460 of file xpred.c.

References begin_builtin, DISP, end_builtin, Errorline(), FALSE, include_var_builtin, real, SetWindowAttribute(), TRUE, and xwindow.

1461 {
1463  ptr_definition types[4];
1464 
1465  types[0] = real;
1466  types[1] = xwindow;
1467  types[2] = real;
1468  types[3] = real;
1469 
1471 
1472  if(SetWindowAttribute(args[1],(Display *)val[0],val[1],val[2],val[3]))
1473  {
1474  XSync(DISP(0),0);
1475  success = TRUE;
1476  }
1477  else
1478  {
1479  Errorline("could not set window attribute in %P.\n",g);
1480  success = FALSE;
1481  }
1482 
1483  end_builtin();
1484 }
static long SetWindowAttribute(ptr_psi_term psi_window, Display *display, Drawable window, unsigned long attributeId, unsigned long attribute)
SetWindowAttribute.
Definition: xpred.c:1318
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
ptr_definition xwindow
Definition: xpred.c:45
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
#define DISP(X)
Definition: xpred.c:149
long xcSetWindowAttribute()
xcSetWindowAttribute
Definition: xpred.c:1460
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcSetWindowGeometry ( )

xcSetWindowGeometry

xcSetWindowGeometry xcSetWindowGeometry(+Display,+Window,+X,+Y,+Width,+Height) set the geometry of the window.

Definition at line 1257 of file xpred.c.

References begin_builtin, DISP, DRAW, end_builtin, include_var_builtin, real, ResizePixmap(), TRUE, and xdrawable.

1258 {
1260  ptr_definition types[6];
1261  long j;
1262 
1263  for(j=0; j<6; j++)
1264  types[j] = real;
1265  types[1] = xdrawable;
1266 
1268 
1269  XMoveResizeWindow(DISP(0),DRAW(1),
1270  val[2],val[3],val[4],val[5]);
1271 
1272  /* modify the pixmap */
1273  ResizePixmap(args[1],(Display *)val[0],val[1],val[4],val[5]);
1274 
1275  success = TRUE;
1276 
1277  end_builtin();
1278 }
#define DRAW(X)
Definition: xpred.c:150
ptr_definition xdrawable
Definition: xpred.c:45
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
#define TRUE
Standard boolean.
Definition: def_const.h:268
long xcSetWindowGeometry()
xcSetWindowGeometry
Definition: xpred.c:1257
#define DISP(X)
Definition: xpred.c:149
static void ResizePixmap(ptr_psi_term psi_window, Display *display, Window window, unsigned long width, unsigned long height)
ResizePixmap.
Definition: xpred.c:400
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcStringWidth ( )

xcStringWidth

StringWidth xcStringWidth(+Connection,+Font,+String) returns the width in pixels of the string in the given font.

Definition at line 2741 of file xpred.c.

References aim, wl_goal::bbbb_1, begin_builtin, DISP, end_builtin, Errorline(), FALSE, FONT, include_var_builtin, quoted_string, REAL, real, STRG, TRUE, and unify_real_result().

2742 {
2744  ptr_definition types[3];
2745  int direction,ascent,descent;
2746  XCharStruct overall;
2747 
2748 
2749  types[0] = real;
2750  types[1] = real;
2751  types[2] = quoted_string;
2752 
2753  begin_builtin(xcStringWidth,3,3,types);
2754 
2755  if(XQueryTextExtents(DISP(0),FONT(1),
2756  STRG(2),strlen(STRG(2)),/* string,nbchars */
2757  &direction,&ascent,&descent,&overall))
2758  {
2759  unify_real_result(aim->bbbb_1,(REAL) overall.width);
2760  success = TRUE;
2761  }
2762  else
2763  {
2764  Errorline("bad font in %P.\n",g);
2765  success = FALSE;
2766  }
2767 
2768  end_builtin();
2769 }
#define FONT(X)
Definition: xpred.c:153
#define STRG(X)
Definition: xpred.c:155
long xcStringWidth()
xcStringWidth
Definition: xpred.c:2741
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
Definition: def_const.h:132
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
void Errorline(char *format,...)
Errorline.
Definition: error.c:465
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define FALSE
Standard boolean.
Definition: def_const.h:275
ptr_goal aim
Definition: def_glob.h:1024
#define DISP(X)
Definition: xpred.c:149
long unify_real_result(ptr_psi_term t, REAL v)
unify_real_result
Definition: built_ins.c:386
ptr_psi_term bbbb_1
Definition: def_struct.h:240
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
ptr_definition quoted_string
symbol in bi module
Definition: def_glob.h:368
long xcSync ( )

xcSync

SYNC xcSync(+Connection,+Discard) flush the output of the connection.

Definition at line 2779 of file xpred.c.

References begin_builtin, DISP, end_builtin, include_var_builtin, real, and TRUE.

2780 {
2782  ptr_definition types[2];
2783 
2784  types[0] = real;
2785  types[1] = real;
2786 
2787  begin_builtin(xcSync,2,2,types);
2788 
2789  XSync(DISP(0),val[1]);
2790  success = TRUE;
2791 
2792  end_builtin();
2793 }
long xcSync()
xcSync
Definition: xpred.c:2779
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define DISP(X)
Definition: xpred.c:149
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcUnloadFont ( )

xcUnloadFont

UnloadFont xcUnloadFont(+Connection,+Font) unload a font.

Definition at line 2631 of file xpred.c.

References begin_builtin, DISP, end_builtin, FONT, include_var_builtin, real, and TRUE.

2632 {
2634  ptr_definition types[2];
2635 
2636  types[0] = real;
2637  types[1] = real;
2638 
2639  begin_builtin(xcUnloadFont,2,2,types);
2640 
2641  XUnloadFont(DISP(0),FONT(1));
2642  XSync(DISP(0),0);
2643  success = TRUE;
2644 
2645  end_builtin();
2646 }
#define FONT(X)
Definition: xpred.c:153
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define DISP(X)
Definition: xpred.c:149
long xcUnloadFont()
xcUnloadFont
Definition: xpred.c:2631
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define end_builtin()
Definition: def_macro.h:259
long xcUnmapSubwindows ( )

xcUnmapSubwindows

xcUnmapSubwindows xcUnmapSubwindows(+Connection,+Window) unmap the sub-windows on the display Connection.

Definition at line 1604 of file xpred.c.

References begin_builtin, DISP, end_builtin, include_var_builtin, push_window(), real, show_subwindow, TRUE, and WIND.

1605 {
1607  ptr_definition types[2];
1608 
1609  types[0] = real;
1610  types[1] = real;
1611 
1612  begin_builtin(xcUnmapSubwindows,2,2,types);
1613 
1614  XUnmapSubwindows(DISP(0),WIND(1));
1615  XSync(DISP(0),0);
1616 
1617  push_window(show_subwindow,(long)DISP(0),WIND(1));
1618  success = TRUE;
1619 
1620  end_builtin();
1621 }
#define show_subwindow
To backtrack on show sub windows RM 8/12/92.
Definition: def_const.h:470
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define DISP(X)
Definition: xpred.c:149
long xcUnmapSubwindows()
xcUnmapSubwindows
Definition: xpred.c:1604
void push_window(long type, long disp, long wind)
push_window
Definition: login.c:548
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define WIND(X)
Definition: xpred.c:151
#define end_builtin()
Definition: def_macro.h:259
long xcUnmapWindow ( )

xcUnmapWindow

xcUnmapWindow xcUnmapWindow(+Connection,+Window) unmap the Window on the display Connection.

Definition at line 1549 of file xpred.c.

References begin_builtin, DISP, end_builtin, include_var_builtin, push_window(), real, show_window, TRUE, and WIND.

1550 {
1552  ptr_definition types[2];
1553 
1554  types[0] = real;
1555  types[1] = real;
1556 
1557  begin_builtin(xcUnmapWindow,2,2,types);
1558 
1559  XUnmapWindow(DISP(0),WIND(1));
1560  XSync(DISP(0),0);
1561 
1562  push_window(show_window,(long)DISP(0),WIND(1));
1563  success = TRUE;
1564 
1565  end_builtin();
1566 }
#define show_window
To backtrack on show window.
Definition: def_const.h:456
long xcUnmapWindow()
xcUnmapWindow
Definition: xpred.c:1549
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
Definition: def_macro.h:203
ptr_definition real
symbol in bi module
Definition: def_glob.h:375
#define TRUE
Standard boolean.
Definition: def_const.h:268
#define DISP(X)
Definition: xpred.c:149
void push_window(long type, long disp, long wind)
push_window
Definition: login.c:548
#define include_var_builtin(NBARGS)
Definition: def_macro.h:196
#define WIND(X)
Definition: xpred.c:151
#define end_builtin()
Definition: def_macro.h:259

Variable Documentation

long x_window_creation = FALSE

Definition at line 53 of file xpred.c.

ptr_definition xbutton_event

Definition at line 45 of file xpred.c.

ptr_definition xconfigure_event

Definition at line 45 of file xpred.c.

ptr_definition xdestroy_event

Definition at line 45 of file xpred.c.

ptr_definition xdisplay

Definition at line 45 of file xpred.c.

ptr_definition xdisplaylist

Definition at line 45 of file xpred.c.

ptr_definition xdrawable

Definition at line 45 of file xpred.c.

ptr_definition xenter_event

Definition at line 45 of file xpred.c.

Definition at line 45 of file xpred.c.

ptr_psi_term xevent_existing = NULL

Definition at line 42 of file xpred.c.

ptr_psi_term xevent_list = NULL

Definition at line 43 of file xpred.c.

long xevent_mask[]
static

Definition at line 57 of file xpred.c.

char* xevent_name[]
static

Definition at line 101 of file xpred.c.

ptr_definition xexpose_event

Definition at line 45 of file xpred.c.

Definition at line 45 of file xpred.c.

ptr_definition xkeyboard_event

Definition at line 45 of file xpred.c.

ptr_definition xleave_event

Definition at line 45 of file xpred.c.

ptr_definition xmisc_event

Definition at line 45 of file xpred.c.

ptr_definition xmotion_event

Definition at line 45 of file xpred.c.

ptr_definition xpixmap

Definition at line 45 of file xpred.c.

ptr_definition xwindow

Definition at line 45 of file xpred.c.