2
* Copyright © 2006 Novell, Inc.
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2 of the License, or (at your option) any later version.
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the
16
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
* Boston, MA 02111-1307, USA.
24
#include <decoration.h>
37
data[5] = input bottom
39
data[6] = input left when maximized
40
data[7] = input right when maximized
41
data[8] = input top when maximized
42
data[9] = input bottom when maximized
49
1st to 4nd bit p1 gravity, 5rd to 8th bit p2 gravity,
50
9rd and 10th bit alignment, 11rd and 12th bit clamp,
51
13th bit XX, 14th bit XY, 15th bit YX, 16th bit YY.
53
data[11 + n * 9 + 1] = flags
54
data[11 + n * 9 + 2] = p1 x
55
data[11 + n * 9 + 3] = p1 y
56
data[11 + n * 9 + 4] = p2 x
57
data[11 + n * 9 + 5] = p2 y
58
data[11 + n * 9 + 6] = widthMax
59
data[11 + n * 9 + 7] = heightMax
60
data[11 + n * 9 + 8] = x0
61
data[11 + n * 9 + 9] = y0
64
decor_quads_to_property (long *data,
66
decor_extents_t *input,
67
decor_extents_t *max_input,
73
*data++ = DECOR_INTERFACE_VERSION;
75
memcpy (data++, &pixmap, sizeof (Pixmap));
77
*data++ = input->left;
78
*data++ = input->right;
80
*data++ = input->bottom;
82
*data++ = max_input->left;
83
*data++ = max_input->right;
84
*data++ = max_input->top;
85
*data++ = max_input->bottom;
93
(quad->p1.gravity << 0) |
94
(quad->p2.gravity << 4) |
97
(quad->m.xx ? XX_MASK : 0) |
98
(quad->m.xy ? XY_MASK : 0) |
99
(quad->m.yx ? YX_MASK : 0) |
100
(quad->m.yy ? YY_MASK : 0);
102
*data++ = quad->p1.x;
103
*data++ = quad->p1.y;
104
*data++ = quad->p2.x;
105
*data++ = quad->p2.y;
106
*data++ = quad->max_width;
107
*data++ = quad->max_height;
108
*data++ = quad->m.x0;
109
*data++ = quad->m.y0;
116
decor_set_horz_quad_line (decor_quad_t *q,
130
dx = (left_corner - right_corner) >> 1;
134
q->p1.gravity = gravity | GRAVITY_WEST;
137
q->p2.gravity = gravity;
138
q->max_width = left + left_corner;
139
q->max_height = SHRT_MAX;
140
q->align = ALIGN_LEFT;
151
q->p1.x = left_corner;
153
q->p1.gravity = gravity | GRAVITY_WEST;
154
q->p2.x = -right_corner;
156
q->p2.gravity = gravity | GRAVITY_EAST;
157
q->max_width = SHRT_MAX;
158
q->max_height = SHRT_MAX;
165
q->m.x0 = x0 + left + left_corner;
172
q->p1.gravity = gravity;
175
q->p2.gravity = gravity | GRAVITY_EAST;
176
q->max_width = right_corner + right;
177
q->max_height = SHRT_MAX;
178
q->align = ALIGN_RIGHT;
184
q->m.x0 = x0 + width;
193
decor_set_vert_quad_row (decor_quad_t *q,
207
dy = (top_corner - bottom_corner) >> 1;
211
q->p1.gravity = gravity | GRAVITY_NORTH;
214
q->p2.gravity = gravity;
215
q->max_width = SHRT_MAX;
216
q->max_height = top + top_corner;
217
q->align = ALIGN_TOP;
218
q->clamp = CLAMP_VERT;
229
q->p1.y = top_corner;
230
q->p1.gravity = gravity | GRAVITY_NORTH;
232
q->p2.y = -bottom_corner;
233
q->p2.gravity = gravity | GRAVITY_SOUTH;
234
q->max_width = SHRT_MAX;
235
q->max_height = SHRT_MAX;
237
q->clamp = CLAMP_VERT;
243
q->m.y0 = y0 + top + top_corner;
249
q->p1.gravity = gravity;
252
q->p2.gravity = gravity | GRAVITY_SOUTH;
253
q->max_width = SHRT_MAX;
254
q->max_height = bottom_corner + bottom;
255
q->align = ALIGN_BOTTOM;
256
q->clamp = CLAMP_VERT;
262
q->m.y0 = y0 + height;
270
decor_set_common_window_quads (decor_context_t *c,
278
n = decor_set_vert_quad_row (q,
282
c->bottom_corner_space,
286
height - c->top_space - c->titlebar_height -
289
c->top_space + c->titlebar_height + 1.0);
294
n = decor_set_vert_quad_row (q,
298
c->bottom_corner_space,
302
height - c->top_space - c->titlebar_height -
304
width - c->right_space,
305
c->top_space + c->titlebar_height + 1.0);
310
n = decor_set_horz_quad_line (q,
312
c->left_corner_space,
314
c->right_corner_space,
320
c->top_space + c->titlebar_height +
321
c->top_corner_space +
322
c->bottom_corner_space + 2.0);
330
decor_set_window_quads (decor_context_t *c,
337
int top_left, top_right, y;
340
top_right = button_width;
341
top_left = width - c->left_space - c->right_space - top_right - 1;
343
/* special case which can happen with large shadows */
344
if (c->right_corner_space > top_right || c->left_corner_space > top_left)
346
y = -c->titlebar_height;
350
n = decor_set_horz_quad_line (q,
352
c->left_corner_space,
354
c->right_corner_space,
355
-c->top_space - c->titlebar_height,
366
y = -c->top_space - c->titlebar_height;
370
/* 3 top/titlebar quads */
371
q->p1.x = -c->left_space;
373
q->p1.gravity = GRAVITY_NORTH | GRAVITY_WEST;
374
q->p2.x = -top_right;
376
q->p2.gravity = GRAVITY_NORTH | GRAVITY_EAST;
377
q->max_width = c->left_space + top_left;
378
q->max_height = SHRT_MAX;
379
q->align = ALIGN_LEFT;
392
q->p1.gravity = GRAVITY_NORTH | GRAVITY_WEST;
393
q->p2.x = -top_right;
395
q->p2.gravity = GRAVITY_NORTH | GRAVITY_EAST;
396
q->max_width = SHRT_MAX;
397
q->max_height = SHRT_MAX;
404
q->m.x0 = c->left_space + top_left;
411
q->p1.gravity = GRAVITY_NORTH | GRAVITY_WEST;
412
q->p2.x = c->right_space;
414
q->p2.gravity = GRAVITY_NORTH | GRAVITY_EAST;
415
q->max_width = c->right_space + top_right;
416
q->max_height = SHRT_MAX;
417
q->align = ALIGN_RIGHT;
428
n = decor_set_common_window_quads (c, q, width, height);
436
decor_set_no_title_window_quads (decor_context_t *c,
444
n = decor_set_horz_quad_line (q,
446
c->left_corner_space,
448
c->right_corner_space,
449
-c->top_space - c->titlebar_height,
458
n = decor_set_common_window_quads (c, q, width, height);
466
decor_set_shadow_quads (decor_context_t *c,
474
n = decor_set_horz_quad_line (q,
476
c->left_corner_space,
478
c->right_corner_space,
489
n = decor_set_vert_quad_row (q,
493
c->bottom_corner_space,
497
height - c->top_space - c->bottom_space,
504
n = decor_set_vert_quad_row (q,
508
c->bottom_corner_space,
512
height - c->top_space - c->bottom_space,
513
width - c->right_space,
519
n = decor_set_horz_quad_line (q,
521
c->left_corner_space,
523
c->right_corner_space,
529
c->top_space + c->top_corner_space +
530
c->bottom_corner_space + 1.0);