~compiz-team/compiz-core/compiz-core.fix_863328

« back to all changes in this revision

Viewing changes to include/decoration.h

  • Committer: David Reveman
  • Date: 2006-11-26 17:11:17 UTC
  • Revision ID: git-v1:a8d0c31f1aafcd6132864299dffd1d20428a9f36
Add libdecoration and move some initial code from gtk-window-decorator into it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2006 Novell, Inc.
 
3
 *
 
4
 * Permission to use, copy, modify, distribute, and sell this software
 
5
 * and its documentation for any purpose is hereby granted without
 
6
 * fee, provided that the above copyright notice appear in all copies
 
7
 * and that both that copyright notice and this permission notice
 
8
 * appear in supporting documentation, and that the name of
 
9
 * Novell, Inc. not be used in advertising or publicity pertaining to
 
10
 * distribution of the software without specific, written prior permission.
 
11
 * Novell, Inc. makes no representations about the suitability of this
 
12
 * software for any purpose. It is provided "as is" without express or
 
13
 * implied warranty.
 
14
 *
 
15
 * NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 
16
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
 
17
 * NO EVENT SHALL NOVELL, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 
18
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
 
19
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 
20
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 
21
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
22
 *
 
23
 * Author: David Reveman <davidr@novell.com>
 
24
 */
 
25
 
 
26
#ifndef _DECORATION_H
 
27
#define _DECORATION_H
 
28
 
 
29
#include <string.h>
 
30
#include <limits.h>
 
31
 
 
32
#include <X11/Xlib.h>
 
33
 
 
34
#define GRAVITY_WEST  (1 << 0)
 
35
#define GRAVITY_EAST  (1 << 1)
 
36
#define GRAVITY_NORTH (1 << 2)
 
37
#define GRAVITY_SOUTH (1 << 3)
 
38
 
 
39
#define ALIGN_LEFT   (0)
 
40
#define ALIGN_RIGHT  (1 << 0)
 
41
#define ALIGN_TOP    (0)
 
42
#define ALIGN_BOTTOM (1 << 1)
 
43
 
 
44
#define CLAMP_HORZ (1 << 0)
 
45
#define CLAMP_VERT (1 << 1)
 
46
 
 
47
#define XX_MASK (1 << 12)
 
48
#define XY_MASK (1 << 13)
 
49
#define YX_MASK (1 << 14)
 
50
#define YY_MASK (1 << 15)
 
51
 
 
52
typedef struct _decor_point {
 
53
    int x;
 
54
    int y;
 
55
    int gravity;
 
56
} decor_point_t;
 
57
 
 
58
typedef struct _decor_matrix {
 
59
    double xx; double yx;
 
60
    double xy; double yy;
 
61
    double x0; double y0;
 
62
} decor_matrix_t;
 
63
 
 
64
typedef struct _decor_quad {
 
65
    decor_point_t  p1;
 
66
    decor_point_t  p2;
 
67
    int            max_width;
 
68
    int            max_height;
 
69
    int            align;
 
70
    int            clamp;
 
71
    decor_matrix_t m;
 
72
} decor_quad_t;
 
73
 
 
74
typedef struct _decor_extents {
 
75
    int left;
 
76
    int right;
 
77
    int top;
 
78
    int bottom;
 
79
} decor_extents_t;
 
80
 
 
81
typedef struct _decor_context decor_context_t;
 
82
 
 
83
struct _decor_context {
 
84
    int left_space;
 
85
    int right_space;
 
86
    int top_space;
 
87
    int bottom_space;
 
88
 
 
89
    int left_corner_space;
 
90
    int right_corner_space;
 
91
    int top_corner_space;
 
92
    int bottom_corner_space;
 
93
 
 
94
    int titlebar_height;
 
95
};
 
96
 
 
97
void
 
98
decor_quads_to_property (long            *data,
 
99
                         Pixmap          pixmap,
 
100
                         decor_extents_t *input,
 
101
                         decor_extents_t *max_input,
 
102
                         int             min_width,
 
103
                         int             min_height,
 
104
                         decor_quad_t    *quad,
 
105
                         int             nQuad);
 
106
 
 
107
int
 
108
decor_set_horz_quad_line (decor_quad_t *q,
 
109
                          int          left,
 
110
                          int          left_corner,
 
111
                          int          right,
 
112
                          int          right_corner,
 
113
                          int          top,
 
114
                          int          bottom,
 
115
                          int          gravity,
 
116
                          int          width,
 
117
                          double       x0,
 
118
                          double       y0);
 
119
 
 
120
int
 
121
decor_set_vert_quad_row (decor_quad_t *q,
 
122
                         int          top,
 
123
                         int          top_corner,
 
124
                         int          bottom,
 
125
                         int          bottom_corner,
 
126
                         int          left,
 
127
                         int          right,
 
128
                         int          gravity,
 
129
                         int          height,
 
130
                         double       x0,
 
131
                         double       y0);
 
132
 
 
133
int
 
134
decor_set_common_window_quads (decor_context_t *c,
 
135
                               decor_quad_t    *q,
 
136
                               int             width,
 
137
                               int             height);
 
138
 
 
139
int
 
140
decor_set_window_quads (decor_context_t *c,
 
141
                        decor_quad_t    *q,
 
142
                        int             width,
 
143
                        int             height,
 
144
                        int             button_width);
 
145
 
 
146
int
 
147
decor_set_no_title_window_quads (decor_context_t *c,
 
148
                                 decor_quad_t    *q,
 
149
                                 int             width,
 
150
                                 int             height);
 
151
 
 
152
int
 
153
decor_set_shadow_quads (decor_context_t *c,
 
154
                        decor_quad_t    *q,
 
155
                        int             width,
 
156
                        int             height);
 
157
 
 
158
#endif