summaryrefslogtreecommitdiffstats
path: root/common/pixman-region.h
blob: 9c82c4d9cd935647cee92902d95aef5039ac5865 (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
/**
 * xrdp: A Remote Desktop Protocol server.
 *
 * Copyright (C) Jay Sorg 2016
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * region, from pixman.h
 */

#if !defined(PIXMAN_PIXMAN_H__)
#define PIXMAN_PIXMAN_H__

typedef int pixman_bool_t;

struct pixman_region16_data
{
    long size;
    long numRects;
};

struct pixman_box16
{
    signed short x1, y1, x2, y2;
};

struct pixman_region16
{
    struct pixman_box16 extents;
    struct pixman_region16_data *data;
};

enum _pixman_region_overlap_t
{
    PIXMAN_REGION_OUT,
    PIXMAN_REGION_IN,
    PIXMAN_REGION_PART
};

typedef enum _pixman_region_overlap_t pixman_region_overlap_t;

typedef struct pixman_region16_data     pixman_region16_data_t;
typedef struct pixman_box16             pixman_box16_t;
typedef struct pixman_region16          pixman_region16_t;

/* creation/destruction */
void                    pixman_region_init               (pixman_region16_t *region);
void                    pixman_region_init_rect          (pixman_region16_t *region,
                                                          int                x,
                                                          int                y,
                                                          unsigned int       width,
                                                          unsigned int       height);
void                    pixman_region_fini               (pixman_region16_t *region);
pixman_bool_t           pixman_region_union              (pixman_region16_t *new_reg,
                                                          pixman_region16_t *reg1,
                                                          pixman_region16_t *reg2);
pixman_bool_t           pixman_region_subtract           (pixman_region16_t *reg_d,
                                                          pixman_region16_t *reg_m,
                                                          pixman_region16_t *reg_s);
pixman_bool_t           pixman_region_intersect          (pixman_region16_t *new_reg,
                                                          pixman_region16_t *reg1,
                                                          pixman_region16_t *reg2);
pixman_box16_t *        pixman_region_rectangles         (pixman_region16_t *region,
                                                          int               *n_rects);

#endif