Ejemplo n.º 1
0
static Object P_Query_Pointer (Object win) {
    Object l, t, z;
    Bool ret;
    Window root, child;
    int r_x, r_y, x, y;
    unsigned int mask;
    GC_Node3;

    Check_Type (win, T_Window);
    ret = XQueryPointer (WINDOW(win)->dpy, WINDOW(win)->win, &root, &child,
        &r_x, &r_y, &x, &y, &mask);
    t = l = P_Make_List (Make_Integer (8), Null);
    GC_Link3 (l, t, win);
    Car (t) = Make_Integer (x); t = Cdr (t);
    Car (t) = Make_Integer (y); t = Cdr (t);
    Car (t) = ret ? True : False; t = Cdr (t);
    z = Make_Window (0, WINDOW(win)->dpy, root);
    Car (t) = z; t = Cdr (t);
    Car (t) = Make_Integer (r_x); t = Cdr (t);
    Car (t) = Make_Integer (r_y); t = Cdr (t);
    z = Make_Window (0, WINDOW(win)->dpy, child);
    Car (t) = z; t = Cdr (t);
    z = Bits_To_Symbols ((unsigned long)mask, 1, State_Syms);
    Car (t) = z;
    GC_Unlink;
    return l;
}
Ejemplo n.º 2
0
static Object P_Query_Tree (Object w) {
    Window root, parent, *children;
    Display *dpy;
    unsigned int i, n;
    Object v, ret;
    GC_Node2;

    Check_Type (w, T_Window);
    dpy = WINDOW(w)->dpy;
    Disable_Interrupts;
    XQueryTree (dpy, WINDOW(w)->win, &root, &parent, &children, &n);
    Enable_Interrupts;
    v = ret = Null;
    GC_Link2 (v, ret);
    v = Make_Window (0, dpy, root);
    ret = Cons (v, Null);
    v = Make_Window (0, dpy, parent);
    ret = Cons (v, ret);
    v = Make_Vector (n, Null);
    for (i = 0; i < n; i++) {
        Object x;

        x = Make_Window (0, dpy, children[i]);
        VECTOR(v)->data[i] = x;
    }
    ret = Cons (v, ret);
    GC_Unlink;
    return ret;
}
Ejemplo n.º 3
0
System::Void Fill_Coordinates_File(std::ofstream& out) {
	Make_House(out);
	Make_Window(out, 100, 140);
	Make_Window(out, 180, 140);
	Make_Balcon(out, 90, 90);
	Make_Balcon(out, 130, 90);
	Make_Balcon(out, 170, 90);
	Make_Balcon(out, 90, 40);
	Make_Balcon(out, 130, 40);
	Make_Balcon(out, 170, 40);
	Make_Asset(out, 20, 150);
}
Ejemplo n.º 4
0
static Object P_Create_Window (Object parent, Object x, Object y, Object width,
                               Object height, Object border_width,
                               Object attr) {
    unsigned long mask;
    Window win;

    Check_Type (parent, T_Window);
    mask = Vector_To_Record (attr, Set_Attr_Size, Sym_Set_Attr, Set_Attr_Rec);
    if ((win = XCreateWindow (WINDOW(parent)->dpy, WINDOW(parent)->win,
            Get_Integer (x), Get_Integer (y), Get_Integer (width),
            Get_Integer (height), Get_Integer (border_width),
            CopyFromParent, CopyFromParent, CopyFromParent, mask, &SWA)) == 0)
        Primitive_Error ("cannot create window");
    return Make_Window (1, WINDOW(parent)->dpy, win);
}
Ejemplo n.º 5
0
static Object P_Translate_Coordinates (Object src, Object x, Object y,
                                       Object dst) {
    int rx, ry;
    Window child;
    Object l, t, z;
    GC_Node3;

    Check_Type (src, T_Window);
    Check_Type (dst, T_Window);
    if (!XTranslateCoordinates (WINDOW(src)->dpy, WINDOW(src)->win,
            WINDOW(dst)->win, Get_Integer (x), Get_Integer (y), &rx, &ry,
            &child))
        return False;
    l = t = P_Make_List (Make_Integer (3), Null);
    GC_Link3 (l, t, dst);
    Car (t) = Make_Integer (rx); t = Cdr (t);
    Car (t) = Make_Integer (ry), t = Cdr (t);
    z = Make_Window (0, WINDOW(dst)->dpy, child);
    Car (t) = z;
    GC_Unlink;
    return l;
}