summaryrefslogtreecommitdiff
path: root/exlcore.c
blob: 51eceaffe4a2f9fb8d50ae514d8532a9dacfed90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#include "exlprivate.h"

enum {
    COPY_AREA = 8;
};

void
exl_core_copy_area (ExlConnection   *connection,
		    ExlCoreDrawable *src,
		    ExlCoreDrawable *dst,
		    ExlCoreGC       *gc,
		    int              src_x,
		    int              src_y,
		    int              width,
		    int              height,
		    int              dst_x,
		    int              dst_y)
{
    _exl_connection_write_request (
	connection, COPY_AREA,
	"XXXiiiiii", src, dst, gc, src_x, src_y, width, height, dst_x, dst_y);
}

ExlCoreWindow *
exl_core_create_window (ExlConnection          *connection,
			ExlCoreWindow          *parent,
			ExlCoreWindowClass      klass,
			int                     depth,
			ExlCoreVisual          *visual,
			int                     x,
			int                     y,
			int                     width,
			int                     height,
			int                     border_width,
			ExlCoreWindowValueMask *mask,
			ExlCoreWindowValues    *values)
{
    ExlCoreWindow *window = _exl_connection_new_id (connection);
    
    _exl_connection_write_request (
	connection, CREATE_WINDOW,
	"XXbXsssssiLi",
	window, parent, depth, visual, x, y, width, height, border_width, bitmask);
}

typedef struct QueryTreeReply QueryTreeReply;
struct QueryTreeReply
{
    ExlCoreQueryTreeReplyFunc	reply_func
    ExlCoreWindow *		window;
    ExlCoreWindow *		parent;
    int				n_children;
    ExlCoreWindow **		children;
};

static void
exl_core_query_tree_reply (ExclConnection *connection,
			   const ExlError *err,
			   void           *data)
{
    QueryTreeReply *reply = data;

    reply->reply_func (
	connection, err,
	reply->window, reply->parent, reply->n_children, reply->children);

    exl_free (reply);
}

void
exl_core_query_tree    (ExlConnection             *connection,
			ExlCoreWindow             *window,
			ExlCoreQueryTreeReplyFunc  reply_func)
{
    QueryTreeReply *reply = exl_new (QueryTreeReply, 1);
    int serial;

    serial = _exl_connection_write_request (connection, QUERY_TREE, "X", window);
    _exl_connection_add_reply_callback (
	connection, reply,
	"XXLX",
	&(reply->root),
	&(reply->parent),
	&(reply->n_children),
	&(reply->children));
}


void
exl_core_intern_atom (ExlConnection *connection,
		      const char    *name,
		      int            only_if_exists)
    ExlCore)
{
    
}