2008-10-02 18:47:02 +00:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* Tint2 : area
|
2009-01-17 14:07:56 +00:00
|
|
|
*
|
2010-11-02 11:40:50 +00:00
|
|
|
* Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution
|
2009-01-17 14:07:56 +00:00
|
|
|
*
|
2008-10-02 18:47:02 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License version 2
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xutil.h>
|
|
|
|
#include <X11/Xatom.h>
|
2010-01-04 16:25:17 +00:00
|
|
|
#include <X11/extensions/Xrender.h>
|
2008-10-02 18:47:02 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2009-01-18 22:12:41 +00:00
|
|
|
#include <pango/pangocairo.h>
|
2008-10-02 18:47:02 +00:00
|
|
|
|
|
|
|
#include "area.h"
|
2009-01-18 22:12:41 +00:00
|
|
|
#include "server.h"
|
2009-02-07 23:28:13 +00:00
|
|
|
#include "panel.h"
|
2015-12-27 13:29:03 +00:00
|
|
|
#include "common.h"
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2015-11-04 00:32:13 +00:00
|
|
|
Area *mouse_over_area = NULL;
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
void init_background(Background *bg)
|
2010-09-21 09:54:19 +00:00
|
|
|
{
|
2015-11-20 22:28:37 +00:00
|
|
|
memset(bg, 0, sizeof(Background));
|
2016-05-17 19:59:43 +00:00
|
|
|
bg->border.mask = BORDER_TOP | BORDER_BOTTOM | BORDER_LEFT | BORDER_RIGHT;
|
2015-11-20 22:28:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void initialize_positions(void *obj, int offset)
|
|
|
|
{
|
|
|
|
Area *a = (Area *)obj;
|
|
|
|
for (GList *l = a->children; l; l = l->next) {
|
|
|
|
Area *child = ((Area *)l->data);
|
2010-09-21 09:54:19 +00:00
|
|
|
if (panel_horizontal) {
|
2016-05-21 13:14:57 +00:00
|
|
|
child->posy = offset + top_border_width(a) + a->paddingy;
|
|
|
|
child->height = a->height - 2 * a->paddingy - top_bottom_border_width(a);
|
2015-01-30 09:53:16 +00:00
|
|
|
if (child->_on_change_layout)
|
|
|
|
child->_on_change_layout(child);
|
2015-11-18 20:57:10 +00:00
|
|
|
initialize_positions(child, child->posy);
|
2015-11-20 22:28:37 +00:00
|
|
|
} else {
|
2016-05-21 13:14:57 +00:00
|
|
|
child->posx = offset + left_border_width(a) + a->paddingy;
|
|
|
|
child->width = a->width - 2 * a->paddingy - left_right_border_width(a);
|
2015-01-30 09:53:16 +00:00
|
|
|
if (child->_on_change_layout)
|
|
|
|
child->_on_change_layout(child);
|
2015-11-18 20:57:10 +00:00
|
|
|
initialize_positions(child, child->posx);
|
2010-09-21 09:54:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
void relayout_fixed(Area *a)
|
2010-08-08 14:06:15 +00:00
|
|
|
{
|
2015-06-11 22:52:10 +00:00
|
|
|
if (!a->on_screen)
|
|
|
|
return;
|
2010-08-10 13:18:17 +00:00
|
|
|
|
2015-11-18 20:57:10 +00:00
|
|
|
// Children are resized before the parent
|
2015-06-11 22:52:10 +00:00
|
|
|
GList *l;
|
2015-11-20 22:28:37 +00:00
|
|
|
for (l = a->children; l; l = l->next)
|
|
|
|
relayout_fixed(l->data);
|
|
|
|
|
2015-11-18 20:57:10 +00:00
|
|
|
// Recalculate size
|
2016-04-22 21:47:28 +00:00
|
|
|
a->_changed = FALSE;
|
2015-11-18 20:57:10 +00:00
|
|
|
if (a->resize_needed && a->size_mode == LAYOUT_FIXED) {
|
2016-04-22 21:47:28 +00:00
|
|
|
a->resize_needed = FALSE;
|
2010-08-08 14:06:15 +00:00
|
|
|
|
2016-04-22 21:47:28 +00:00
|
|
|
if (a->_resize && a->_resize(a)) {
|
|
|
|
// The size has changed => resize needed for the parent
|
|
|
|
if (a->parent)
|
|
|
|
((Area *)a->parent)->resize_needed = TRUE;
|
|
|
|
a->_changed = TRUE;
|
2010-08-08 19:23:54 +00:00
|
|
|
}
|
2010-08-08 14:06:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
void relayout_dynamic(Area *a, int level)
|
2010-08-08 14:06:15 +00:00
|
|
|
{
|
2015-06-11 22:52:10 +00:00
|
|
|
if (!a->on_screen)
|
|
|
|
return;
|
2010-08-10 13:18:17 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
// Area is resized before its children
|
2015-11-18 20:57:10 +00:00
|
|
|
if (a->resize_needed && a->size_mode == LAYOUT_DYNAMIC) {
|
2016-04-22 21:47:28 +00:00
|
|
|
a->resize_needed = FALSE;
|
2010-08-08 14:06:15 +00:00
|
|
|
|
2010-08-08 19:23:54 +00:00
|
|
|
if (a->_resize) {
|
2016-04-22 21:47:28 +00:00
|
|
|
if (a->_resize(a))
|
|
|
|
a->_changed = TRUE;
|
2015-11-18 20:57:10 +00:00
|
|
|
// resize children with LAYOUT_DYNAMIC
|
2015-11-20 22:28:37 +00:00
|
|
|
for (GList *l = a->children; l; l = l->next) {
|
|
|
|
Area *child = ((Area *)l->data);
|
2015-11-18 20:57:10 +00:00
|
|
|
if (child->size_mode == LAYOUT_DYNAMIC && child->children)
|
|
|
|
child->resize_needed = 1;
|
2010-08-08 19:23:54 +00:00
|
|
|
}
|
|
|
|
}
|
2010-08-08 14:06:15 +00:00
|
|
|
}
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
// Layout children
|
2015-11-04 01:37:10 +00:00
|
|
|
if (a->children) {
|
2015-06-11 22:52:10 +00:00
|
|
|
if (a->alignment == ALIGN_LEFT) {
|
2016-05-21 13:14:57 +00:00
|
|
|
int pos =
|
|
|
|
(panel_horizontal ? a->posx + left_border_width(a) : a->posy + top_border_width(a)) + a->paddingxlr;
|
2015-06-11 22:52:10 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
for (GList *l = a->children; l; l = l->next) {
|
|
|
|
Area *child = ((Area *)l->data);
|
2015-06-11 22:52:10 +00:00
|
|
|
if (!child->on_screen)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (panel_horizontal) {
|
|
|
|
if (pos != child->posx) {
|
|
|
|
// pos changed => redraw
|
|
|
|
child->posx = pos;
|
2016-04-22 21:47:28 +00:00
|
|
|
child->_changed = TRUE;
|
2015-06-11 22:52:10 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (pos != child->posy) {
|
|
|
|
// pos changed => redraw
|
|
|
|
child->posy = pos;
|
2016-04-22 21:47:28 +00:00
|
|
|
child->_changed = TRUE;
|
2015-06-11 22:52:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
relayout_dynamic(child, level + 1);
|
2015-06-11 22:52:10 +00:00
|
|
|
|
|
|
|
pos += panel_horizontal ? child->width + a->paddingx : child->height + a->paddingx;
|
2010-09-19 10:01:06 +00:00
|
|
|
}
|
2015-06-11 22:52:10 +00:00
|
|
|
} else if (a->alignment == ALIGN_RIGHT) {
|
2016-05-21 13:14:57 +00:00
|
|
|
int pos = (panel_horizontal ? a->posx + a->width - right_border_width(a)
|
|
|
|
: a->posy + a->height - bottom_border_width(a)) -
|
|
|
|
a->paddingxlr;
|
2015-06-11 22:52:10 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
for (GList *l = g_list_last(a->children); l; l = l->prev) {
|
|
|
|
Area *child = ((Area *)l->data);
|
2015-06-11 22:52:10 +00:00
|
|
|
if (!child->on_screen)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
pos -= panel_horizontal ? child->width : child->height;
|
|
|
|
|
|
|
|
if (panel_horizontal) {
|
|
|
|
if (pos != child->posx) {
|
|
|
|
// pos changed => redraw
|
|
|
|
child->posx = pos;
|
2016-04-22 21:47:28 +00:00
|
|
|
child->_changed = TRUE;
|
2015-06-11 22:52:10 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (pos != child->posy) {
|
|
|
|
// pos changed => redraw
|
|
|
|
child->posy = pos;
|
2016-04-22 21:47:28 +00:00
|
|
|
child->_changed = TRUE;
|
2015-06-11 22:52:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
relayout_dynamic(child, level + 1);
|
2015-06-11 22:52:10 +00:00
|
|
|
|
|
|
|
pos -= a->paddingx;
|
|
|
|
}
|
|
|
|
} else if (a->alignment == ALIGN_CENTER) {
|
|
|
|
|
|
|
|
int children_size = 0;
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
for (GList *l = a->children; l; l = l->next) {
|
|
|
|
Area *child = ((Area *)l->data);
|
2015-06-11 22:52:10 +00:00
|
|
|
if (!child->on_screen)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
children_size += panel_horizontal ? child->width : child->height;
|
2015-11-04 01:37:10 +00:00
|
|
|
children_size += (l == a->children) ? 0 : a->paddingx;
|
2015-06-11 22:52:10 +00:00
|
|
|
}
|
|
|
|
|
2016-05-21 13:14:57 +00:00
|
|
|
int pos = (panel_horizontal ? a->posx + left_border_width(a) : a->posy + top_border_width(a)) + a->paddingxlr;
|
2015-06-11 22:52:10 +00:00
|
|
|
pos += ((panel_horizontal ? a->width : a->height) - children_size) / 2;
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
for (GList *l = a->children; l; l = l->next) {
|
|
|
|
Area *child = ((Area *)l->data);
|
2015-06-11 22:52:10 +00:00
|
|
|
if (!child->on_screen)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (panel_horizontal) {
|
|
|
|
if (pos != child->posx) {
|
|
|
|
// pos changed => redraw
|
|
|
|
child->posx = pos;
|
2016-04-22 21:47:28 +00:00
|
|
|
child->_changed = TRUE;
|
2015-06-11 22:52:10 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (pos != child->posy) {
|
|
|
|
// pos changed => redraw
|
|
|
|
child->posy = pos;
|
2016-04-22 21:47:28 +00:00
|
|
|
child->_changed = TRUE;
|
2015-06-11 22:52:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
relayout_dynamic(child, level + 1);
|
2015-06-11 22:52:10 +00:00
|
|
|
|
|
|
|
pos += panel_horizontal ? child->width + a->paddingx : child->height + a->paddingx;
|
2010-09-19 10:01:06 +00:00
|
|
|
}
|
2010-09-18 10:41:34 +00:00
|
|
|
}
|
2015-06-11 22:52:10 +00:00
|
|
|
}
|
2010-09-26 13:10:37 +00:00
|
|
|
|
2015-11-18 20:57:10 +00:00
|
|
|
if (a->_changed) {
|
2010-09-26 13:10:37 +00:00
|
|
|
// pos/size changed
|
2016-01-01 03:57:08 +00:00
|
|
|
a->_redraw_needed = TRUE;
|
2010-09-26 13:10:37 +00:00
|
|
|
if (a->_on_change_layout)
|
2015-11-20 22:28:37 +00:00
|
|
|
a->_on_change_layout(a);
|
2010-09-18 10:41:34 +00:00
|
|
|
}
|
2010-08-08 14:06:15 +00:00
|
|
|
}
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
void relayout(Area *a)
|
|
|
|
{
|
|
|
|
relayout_fixed(a);
|
|
|
|
relayout_dynamic(a, 1);
|
|
|
|
}
|
2009-02-27 22:18:30 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
void draw_tree(Area *a)
|
2010-09-16 23:24:25 +00:00
|
|
|
{
|
2015-11-18 20:57:10 +00:00
|
|
|
if (!a->on_screen)
|
|
|
|
return;
|
2010-09-16 23:24:25 +00:00
|
|
|
|
2016-01-01 03:57:08 +00:00
|
|
|
if (a->_redraw_needed) {
|
2016-04-22 21:47:28 +00:00
|
|
|
a->_redraw_needed = FALSE;
|
2010-09-16 23:24:25 +00:00
|
|
|
draw(a);
|
|
|
|
}
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
if (a->pix)
|
2016-03-24 19:45:17 +00:00
|
|
|
XCopyArea(server.display,
|
2016-05-21 13:14:57 +00:00
|
|
|
a->pix,
|
|
|
|
((Panel *)a->panel)->temp_pmap,
|
|
|
|
server.gc,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
a->width,
|
|
|
|
a->height,
|
|
|
|
a->posx,
|
|
|
|
a->posy);
|
2010-09-16 23:24:25 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
for (GList *l = a->children; l; l = l->next)
|
|
|
|
draw_tree((Area *)l->data);
|
2010-09-16 23:24:25 +00:00
|
|
|
}
|
|
|
|
|
2015-11-18 20:57:10 +00:00
|
|
|
int relayout_with_constraint(Area *a, int maximum_size)
|
2010-09-21 09:54:19 +00:00
|
|
|
{
|
2015-11-20 22:28:37 +00:00
|
|
|
int fixed_children_count = 0;
|
|
|
|
int dynamic_children_count = 0;
|
|
|
|
|
|
|
|
if (panel_horizontal) {
|
|
|
|
// detect free size for LAYOUT_DYNAMIC Areas
|
2016-05-21 13:14:57 +00:00
|
|
|
int size = a->width - 2 * a->paddingxlr - left_right_border_width(a);
|
2015-11-20 22:28:37 +00:00
|
|
|
for (GList *l = a->children; l; l = l->next) {
|
|
|
|
Area *child = (Area *)l->data;
|
2015-11-18 20:57:10 +00:00
|
|
|
if (child->on_screen && child->size_mode == LAYOUT_FIXED) {
|
2010-09-22 22:01:37 +00:00
|
|
|
size -= child->width;
|
2015-11-20 22:28:37 +00:00
|
|
|
fixed_children_count++;
|
2010-09-22 22:01:37 +00:00
|
|
|
}
|
2015-11-18 20:57:10 +00:00
|
|
|
if (child->on_screen && child->size_mode == LAYOUT_DYNAMIC)
|
2015-11-20 22:28:37 +00:00
|
|
|
dynamic_children_count++;
|
2010-09-22 22:01:37 +00:00
|
|
|
}
|
2015-11-20 22:28:37 +00:00
|
|
|
if (fixed_children_count + dynamic_children_count > 0)
|
|
|
|
size -= (fixed_children_count + dynamic_children_count - 1) * a->paddingx;
|
|
|
|
|
|
|
|
int width = 0;
|
|
|
|
int modulo = 0;
|
|
|
|
if (dynamic_children_count > 0) {
|
|
|
|
width = size / dynamic_children_count;
|
|
|
|
modulo = size % dynamic_children_count;
|
|
|
|
if (width > maximum_size && maximum_size > 0) {
|
2010-09-26 17:07:33 +00:00
|
|
|
width = maximum_size;
|
|
|
|
modulo = 0;
|
|
|
|
}
|
2010-09-21 09:54:19 +00:00
|
|
|
}
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
// Resize LAYOUT_DYNAMIC objects
|
|
|
|
for (GList *l = a->children; l; l = l->next) {
|
|
|
|
Area *child = (Area *)l->data;
|
2015-11-18 20:57:10 +00:00
|
|
|
if (child->on_screen && child->size_mode == LAYOUT_DYNAMIC) {
|
2015-11-20 22:28:37 +00:00
|
|
|
int old_width = child->width;
|
2010-09-22 22:01:37 +00:00
|
|
|
child->width = width;
|
|
|
|
if (modulo) {
|
|
|
|
child->width++;
|
|
|
|
modulo--;
|
|
|
|
}
|
2010-09-26 13:10:37 +00:00
|
|
|
if (child->width != old_width)
|
2016-04-22 21:47:28 +00:00
|
|
|
child->_changed = TRUE;
|
2010-09-21 09:54:19 +00:00
|
|
|
}
|
|
|
|
}
|
2015-11-20 22:28:37 +00:00
|
|
|
} else {
|
2015-11-18 20:57:10 +00:00
|
|
|
// detect free size for LAYOUT_DYNAMIC's Area
|
2016-05-21 13:14:57 +00:00
|
|
|
int size = a->height - 2 * a->paddingxlr - top_bottom_border_width(a);
|
2015-11-20 22:28:37 +00:00
|
|
|
for (GList *l = a->children; l; l = l->next) {
|
|
|
|
Area *child = (Area *)l->data;
|
2015-11-18 20:57:10 +00:00
|
|
|
if (child->on_screen && child->size_mode == LAYOUT_FIXED) {
|
2010-09-22 22:01:37 +00:00
|
|
|
size -= child->height;
|
2015-11-20 22:28:37 +00:00
|
|
|
fixed_children_count++;
|
2010-09-22 22:01:37 +00:00
|
|
|
}
|
2015-11-18 20:57:10 +00:00
|
|
|
if (child->on_screen && child->size_mode == LAYOUT_DYNAMIC)
|
2015-11-20 22:28:37 +00:00
|
|
|
dynamic_children_count++;
|
2010-09-22 22:01:37 +00:00
|
|
|
}
|
2015-11-20 22:28:37 +00:00
|
|
|
if (fixed_children_count + dynamic_children_count > 0)
|
|
|
|
size -= (fixed_children_count + dynamic_children_count - 1) * a->paddingx;
|
|
|
|
|
|
|
|
int height = 0;
|
|
|
|
int modulo = 0;
|
|
|
|
if (dynamic_children_count) {
|
|
|
|
height = size / dynamic_children_count;
|
|
|
|
modulo = size % dynamic_children_count;
|
2010-09-26 17:07:33 +00:00
|
|
|
if (height > maximum_size && maximum_size != 0) {
|
|
|
|
height = maximum_size;
|
|
|
|
modulo = 0;
|
|
|
|
}
|
2010-09-21 09:54:19 +00:00
|
|
|
}
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
// Resize LAYOUT_DYNAMIC objects
|
|
|
|
for (GList *l = a->children; l; l = l->next) {
|
|
|
|
Area *child = (Area *)l->data;
|
2015-11-18 20:57:10 +00:00
|
|
|
if (child->on_screen && child->size_mode == LAYOUT_DYNAMIC) {
|
2015-06-11 22:52:10 +00:00
|
|
|
int old_height = child->height;
|
2010-09-22 22:01:37 +00:00
|
|
|
child->height = height;
|
|
|
|
if (modulo) {
|
|
|
|
child->height++;
|
|
|
|
modulo--;
|
|
|
|
}
|
2010-09-26 13:10:37 +00:00
|
|
|
if (child->height != old_height)
|
2016-04-22 21:47:28 +00:00
|
|
|
child->_changed = TRUE;
|
2010-09-21 09:54:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-11-18 20:57:10 +00:00
|
|
|
void schedule_redraw(Area *a)
|
2008-10-02 18:47:02 +00:00
|
|
|
{
|
2016-01-01 03:57:08 +00:00
|
|
|
a->_redraw_needed = TRUE;
|
|
|
|
|
|
|
|
if (a->has_mouse_over_effect) {
|
|
|
|
for (int i = 0; i < MOUSE_STATE_COUNT; i++) {
|
2016-01-01 12:49:10 +00:00
|
|
|
XFreePixmap(server.display, a->pix_by_state[i]);
|
2016-01-01 03:57:08 +00:00
|
|
|
if (a->pix == a->pix_by_state[i])
|
|
|
|
a->pix = None;
|
|
|
|
a->pix_by_state[i] = None;
|
|
|
|
}
|
|
|
|
if (a->pix) {
|
2016-01-01 12:49:10 +00:00
|
|
|
XFreePixmap(server.display, a->pix);
|
2016-01-01 03:57:08 +00:00
|
|
|
a->pix = None;
|
|
|
|
}
|
|
|
|
}
|
2009-01-17 14:07:56 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
for (GList *l = a->children; l; l = l->next)
|
|
|
|
schedule_redraw((Area *)l->data);
|
2015-11-22 15:33:58 +00:00
|
|
|
panel_refresh = TRUE;
|
2008-10-02 18:47:02 +00:00
|
|
|
}
|
|
|
|
|
2010-09-22 19:33:10 +00:00
|
|
|
void hide(Area *a)
|
|
|
|
{
|
2015-11-20 22:28:37 +00:00
|
|
|
Area *parent = (Area *)a->parent;
|
2010-09-22 19:33:10 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
a->on_screen = FALSE;
|
2015-11-18 20:57:10 +00:00
|
|
|
if (parent)
|
2016-04-22 21:47:28 +00:00
|
|
|
parent->resize_needed = TRUE;
|
2010-09-22 19:33:10 +00:00
|
|
|
if (panel_horizontal)
|
|
|
|
a->width = 0;
|
|
|
|
else
|
|
|
|
a->height = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void show(Area *a)
|
|
|
|
{
|
2015-11-20 22:28:37 +00:00
|
|
|
Area *parent = (Area *)a->parent;
|
2010-09-22 19:33:10 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
a->on_screen = TRUE;
|
2015-11-18 20:57:10 +00:00
|
|
|
if (parent)
|
2016-04-22 21:47:28 +00:00
|
|
|
parent->resize_needed = TRUE;
|
|
|
|
a->resize_needed = TRUE;
|
2010-09-22 19:33:10 +00:00
|
|
|
}
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2015-11-18 20:57:10 +00:00
|
|
|
void draw(Area *a)
|
2008-10-02 18:47:02 +00:00
|
|
|
{
|
2016-04-22 21:47:28 +00:00
|
|
|
if (a->_changed) {
|
|
|
|
// On resize/move, invalidate cached pixmaps
|
|
|
|
for (int i = 0; i < MOUSE_STATE_COUNT; i++) {
|
|
|
|
XFreePixmap(server.display, a->pix_by_state[i]);
|
|
|
|
if (a->pix == a->pix_by_state[i]) {
|
|
|
|
a->pix = None;
|
|
|
|
}
|
|
|
|
a->pix_by_state[i] = None;
|
|
|
|
}
|
|
|
|
if (a->pix) {
|
|
|
|
XFreePixmap(server.display, a->pix);
|
|
|
|
a->pix = None;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-01 03:57:08 +00:00
|
|
|
if (a->pix) {
|
2016-01-01 12:49:10 +00:00
|
|
|
XFreePixmap(server.display, a->pix);
|
2016-01-01 03:57:08 +00:00
|
|
|
if (a->pix_by_state[a->has_mouse_over_effect ? a->mouse_state : 0] != a->pix)
|
2016-01-01 12:49:10 +00:00
|
|
|
XFreePixmap(server.display, a->pix_by_state[a->has_mouse_over_effect ? a->mouse_state : 0]);
|
2016-01-01 03:57:08 +00:00
|
|
|
}
|
2016-01-01 12:49:10 +00:00
|
|
|
a->pix = XCreatePixmap(server.display, server.root_win, a->width, a->height, server.depth);
|
2016-01-01 03:57:08 +00:00
|
|
|
a->pix_by_state[a->has_mouse_over_effect ? a->mouse_state : 0] = a->pix;
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2016-01-24 12:39:52 +00:00
|
|
|
if (!a->_clear) {
|
2016-01-27 09:11:48 +00:00
|
|
|
// Add layer of root pixmap (or clear pixmap if real_transparency==true)
|
|
|
|
if (server.real_transparency)
|
|
|
|
clear_pixmap(a->pix, 0, 0, a->width, a->height);
|
2016-03-24 19:45:17 +00:00
|
|
|
XCopyArea(server.display,
|
2016-05-21 13:14:57 +00:00
|
|
|
((Panel *)a->panel)->temp_pmap,
|
|
|
|
a->pix,
|
|
|
|
server.gc,
|
|
|
|
a->posx,
|
|
|
|
a->posy,
|
|
|
|
a->width,
|
|
|
|
a->height,
|
|
|
|
0,
|
|
|
|
0);
|
2016-01-24 12:39:52 +00:00
|
|
|
} else {
|
|
|
|
a->_clear(a);
|
|
|
|
}
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2016-01-01 12:49:10 +00:00
|
|
|
cairo_surface_t *cs = cairo_xlib_surface_create(server.display, a->pix, server.visual, a->width, a->height);
|
2015-11-20 22:28:37 +00:00
|
|
|
cairo_t *c = cairo_create(cs);
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2015-11-18 20:57:10 +00:00
|
|
|
draw_background(a, c);
|
2009-01-17 14:07:56 +00:00
|
|
|
|
2009-09-07 21:41:21 +00:00
|
|
|
if (a->_draw_foreground)
|
2010-01-09 00:11:01 +00:00
|
|
|
a->_draw_foreground(a, c);
|
2008-11-08 20:23:42 +00:00
|
|
|
|
2015-11-18 20:57:10 +00:00
|
|
|
cairo_destroy(c);
|
|
|
|
cairo_surface_destroy(cs);
|
2008-10-02 18:47:02 +00:00
|
|
|
}
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
void draw_background(Area *a, cairo_t *c)
|
2008-10-02 18:47:02 +00:00
|
|
|
{
|
2015-11-18 20:57:10 +00:00
|
|
|
if (a->bg->fill_color.alpha > 0.0 ||
|
2016-05-21 13:14:57 +00:00
|
|
|
(panel_config.mouse_effects && (a->has_mouse_over_effect || a->has_mouse_press_effect))) {
|
2015-11-04 11:19:23 +00:00
|
|
|
if (a->mouse_state == MOUSE_OVER)
|
2015-11-20 22:28:37 +00:00
|
|
|
cairo_set_source_rgba(c,
|
2016-05-21 13:14:57 +00:00
|
|
|
a->bg->fill_color_hover.rgb[0],
|
|
|
|
a->bg->fill_color_hover.rgb[1],
|
|
|
|
a->bg->fill_color_hover.rgb[2],
|
|
|
|
a->bg->fill_color_hover.alpha);
|
2015-11-04 11:19:23 +00:00
|
|
|
else if (a->mouse_state == MOUSE_DOWN)
|
2015-11-20 22:28:37 +00:00
|
|
|
cairo_set_source_rgba(c,
|
2016-05-21 13:14:57 +00:00
|
|
|
a->bg->fill_color_pressed.rgb[0],
|
|
|
|
a->bg->fill_color_pressed.rgb[1],
|
|
|
|
a->bg->fill_color_pressed.rgb[2],
|
|
|
|
a->bg->fill_color_pressed.alpha);
|
2015-11-04 11:19:23 +00:00
|
|
|
else
|
2015-11-20 22:28:37 +00:00
|
|
|
cairo_set_source_rgba(c,
|
2016-05-21 13:14:57 +00:00
|
|
|
a->bg->fill_color.rgb[0],
|
|
|
|
a->bg->fill_color.rgb[1],
|
|
|
|
a->bg->fill_color.rgb[2],
|
|
|
|
a->bg->fill_color.alpha);
|
2016-05-17 19:59:43 +00:00
|
|
|
// Not sure about this
|
2015-11-20 22:28:37 +00:00
|
|
|
draw_rect(c,
|
2016-05-21 13:14:57 +00:00
|
|
|
left_border_width(a),
|
|
|
|
top_border_width(a),
|
|
|
|
a->width - left_right_border_width(a),
|
|
|
|
a->height - top_bottom_border_width(a),
|
|
|
|
a->bg->border.radius - a->bg->border.width / 1.571);
|
2016-05-17 19:59:43 +00:00
|
|
|
|
2009-09-07 21:41:21 +00:00
|
|
|
cairo_fill(c);
|
|
|
|
}
|
|
|
|
|
2015-11-04 00:32:13 +00:00
|
|
|
if (a->bg->border.width > 0) {
|
2015-11-20 22:28:37 +00:00
|
|
|
cairo_set_line_width(c, a->bg->border.width);
|
2009-09-07 21:41:21 +00:00
|
|
|
|
|
|
|
// draw border inside (x, y, width, height)
|
2015-11-04 11:19:23 +00:00
|
|
|
if (a->mouse_state == MOUSE_OVER)
|
2015-11-20 22:28:37 +00:00
|
|
|
cairo_set_source_rgba(c,
|
2016-05-21 13:14:57 +00:00
|
|
|
a->bg->border_color_hover.rgb[0],
|
|
|
|
a->bg->border_color_hover.rgb[1],
|
|
|
|
a->bg->border_color_hover.rgb[2],
|
|
|
|
a->bg->border_color_hover.alpha);
|
2015-11-04 11:19:23 +00:00
|
|
|
else if (a->mouse_state == MOUSE_DOWN)
|
2015-11-20 22:28:37 +00:00
|
|
|
cairo_set_source_rgba(c,
|
2016-05-21 13:14:57 +00:00
|
|
|
a->bg->border_color_pressed.rgb[0],
|
|
|
|
a->bg->border_color_pressed.rgb[1],
|
|
|
|
a->bg->border_color_pressed.rgb[2],
|
|
|
|
a->bg->border_color_pressed.alpha);
|
2015-11-04 11:19:23 +00:00
|
|
|
else
|
2015-11-20 22:28:37 +00:00
|
|
|
cairo_set_source_rgba(c,
|
2016-05-21 13:14:57 +00:00
|
|
|
a->bg->border.color.rgb[0],
|
|
|
|
a->bg->border.color.rgb[1],
|
|
|
|
a->bg->border.color.rgb[2],
|
|
|
|
a->bg->border.color.alpha);
|
2016-05-17 19:59:43 +00:00
|
|
|
draw_rect_on_sides(c,
|
2016-05-21 13:14:57 +00:00
|
|
|
left_border_width(a) / 2.,
|
|
|
|
top_border_width(a) / 2.,
|
|
|
|
a->width - left_right_border_width(a) / 2.,
|
|
|
|
a->height - top_bottom_border_width(a) / 2.,
|
|
|
|
a->bg->border.radius,
|
|
|
|
a->bg->border.mask);
|
2015-11-04 00:32:13 +00:00
|
|
|
|
|
|
|
cairo_stroke(c);
|
2009-09-07 21:41:21 +00:00
|
|
|
}
|
2008-10-02 18:47:02 +00:00
|
|
|
}
|
|
|
|
|
2015-11-18 20:57:10 +00:00
|
|
|
void remove_area(Area *a)
|
2008-10-02 18:47:02 +00:00
|
|
|
{
|
2015-11-20 22:28:37 +00:00
|
|
|
Area *area = (Area *)a;
|
|
|
|
Area *parent = (Area *)area->parent;
|
2009-01-17 14:07:56 +00:00
|
|
|
|
2015-11-04 11:25:49 +00:00
|
|
|
if (parent) {
|
|
|
|
parent->children = g_list_remove(parent->children, area);
|
2015-11-22 15:33:58 +00:00
|
|
|
parent->resize_needed = TRUE;
|
|
|
|
panel_refresh = TRUE;
|
2015-11-18 20:57:10 +00:00
|
|
|
schedule_redraw(parent);
|
2015-11-04 11:25:49 +00:00
|
|
|
}
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2015-11-04 00:32:13 +00:00
|
|
|
if (mouse_over_area == a) {
|
2015-11-04 11:19:23 +00:00
|
|
|
mouse_out();
|
2015-11-04 00:32:13 +00:00
|
|
|
}
|
2008-10-02 18:47:02 +00:00
|
|
|
}
|
|
|
|
|
2015-11-18 20:57:10 +00:00
|
|
|
void add_area(Area *a, Area *parent)
|
2008-10-02 18:47:02 +00:00
|
|
|
{
|
2015-11-18 20:57:10 +00:00
|
|
|
g_assert_null(a->parent);
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2015-11-18 20:57:10 +00:00
|
|
|
a->parent = parent;
|
|
|
|
if (parent) {
|
|
|
|
parent->children = g_list_append(parent->children, a);
|
2015-11-22 15:33:58 +00:00
|
|
|
parent->resize_needed = TRUE;
|
2015-11-18 20:57:10 +00:00
|
|
|
schedule_redraw(parent);
|
2015-11-22 15:33:58 +00:00
|
|
|
panel_refresh = TRUE;
|
2015-11-18 20:57:10 +00:00
|
|
|
}
|
2008-10-02 18:47:02 +00:00
|
|
|
}
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
void free_area(Area *a)
|
2008-11-08 20:23:42 +00:00
|
|
|
{
|
2015-04-11 09:51:10 +00:00
|
|
|
if (!a)
|
|
|
|
return;
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
for (GList *l = a->children; l; l = l->next)
|
|
|
|
free_area(l->data);
|
2009-09-07 21:41:21 +00:00
|
|
|
|
2015-11-04 01:37:10 +00:00
|
|
|
if (a->children) {
|
|
|
|
g_list_free(a->children);
|
2016-01-01 03:57:08 +00:00
|
|
|
a->children = NULL;
|
|
|
|
}
|
|
|
|
for (int i = 0; i < MOUSE_STATE_COUNT; i++) {
|
2016-01-01 12:49:10 +00:00
|
|
|
XFreePixmap(server.display, a->pix_by_state[i]);
|
2016-01-01 03:57:08 +00:00
|
|
|
if (a->pix == a->pix_by_state[i]) {
|
|
|
|
a->pix = None;
|
|
|
|
}
|
|
|
|
a->pix_by_state[i] = None;
|
2009-02-13 21:54:42 +00:00
|
|
|
}
|
2010-01-09 00:11:01 +00:00
|
|
|
if (a->pix) {
|
2016-01-01 12:49:10 +00:00
|
|
|
XFreePixmap(server.display, a->pix);
|
2016-01-01 03:57:08 +00:00
|
|
|
a->pix = None;
|
2009-02-13 21:54:42 +00:00
|
|
|
}
|
2015-11-04 00:32:13 +00:00
|
|
|
if (mouse_over_area == a) {
|
|
|
|
mouse_over_area = NULL;
|
|
|
|
}
|
2008-11-08 20:23:42 +00:00
|
|
|
}
|
|
|
|
|
2015-11-04 11:19:23 +00:00
|
|
|
void mouse_over(Area *area, int pressed)
|
2015-11-04 00:32:13 +00:00
|
|
|
{
|
2015-11-04 11:19:23 +00:00
|
|
|
if (mouse_over_area == area && !area)
|
|
|
|
return;
|
|
|
|
|
|
|
|
MouseState new_state = MOUSE_NORMAL;
|
|
|
|
if (area) {
|
|
|
|
if (!pressed) {
|
2015-11-18 20:57:10 +00:00
|
|
|
new_state = area->has_mouse_over_effect ? MOUSE_OVER : MOUSE_NORMAL;
|
2015-11-04 11:19:23 +00:00
|
|
|
} else {
|
2016-03-24 19:45:17 +00:00
|
|
|
new_state =
|
2016-05-21 13:14:57 +00:00
|
|
|
area->has_mouse_press_effect ? MOUSE_DOWN : area->has_mouse_over_effect ? MOUSE_OVER : MOUSE_NORMAL;
|
2015-11-04 11:19:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mouse_over_area == area && mouse_over_area->mouse_state == new_state)
|
2015-11-04 00:32:13 +00:00
|
|
|
return;
|
|
|
|
mouse_out();
|
2015-11-04 11:19:23 +00:00
|
|
|
if (new_state == MOUSE_NORMAL)
|
2015-11-04 00:32:13 +00:00
|
|
|
return;
|
|
|
|
mouse_over_area = area;
|
|
|
|
|
2015-11-04 11:19:23 +00:00
|
|
|
mouse_over_area->mouse_state = new_state;
|
2016-03-24 19:45:17 +00:00
|
|
|
mouse_over_area->pix =
|
2016-05-21 13:14:57 +00:00
|
|
|
mouse_over_area->pix_by_state[mouse_over_area->has_mouse_over_effect ? mouse_over_area->mouse_state : 0];
|
2016-01-01 03:57:08 +00:00
|
|
|
if (!mouse_over_area->pix)
|
|
|
|
mouse_over_area->_redraw_needed = TRUE;
|
2015-11-20 22:28:37 +00:00
|
|
|
panel_refresh = TRUE;
|
2015-11-04 00:32:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void mouse_out()
|
|
|
|
{
|
|
|
|
if (!mouse_over_area)
|
|
|
|
return;
|
|
|
|
mouse_over_area->mouse_state = MOUSE_NORMAL;
|
2016-03-24 19:45:17 +00:00
|
|
|
mouse_over_area->pix =
|
2016-05-21 13:14:57 +00:00
|
|
|
mouse_over_area->pix_by_state[mouse_over_area->has_mouse_over_effect ? mouse_over_area->mouse_state : 0];
|
2016-01-01 03:57:08 +00:00
|
|
|
if (!mouse_over_area->pix)
|
|
|
|
mouse_over_area->_redraw_needed = TRUE;
|
2015-11-20 22:28:37 +00:00
|
|
|
panel_refresh = TRUE;
|
2015-11-04 00:32:13 +00:00
|
|
|
mouse_over_area = NULL;
|
|
|
|
}
|
2016-02-27 12:41:36 +00:00
|
|
|
|
2016-03-25 09:08:24 +00:00
|
|
|
gboolean area_is_first(void *obj)
|
|
|
|
{
|
|
|
|
Area *a = obj;
|
|
|
|
if (!a->on_screen)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
Panel *panel = a->panel;
|
|
|
|
|
|
|
|
Area *node = &panel->area;
|
|
|
|
|
|
|
|
while (node) {
|
2016-03-25 10:12:26 +00:00
|
|
|
if (!node->on_screen || node->width == 0 || node->height == 0)
|
2016-03-25 09:08:24 +00:00
|
|
|
return FALSE;
|
|
|
|
if (node == a)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
GList *l = node->children;
|
|
|
|
node = NULL;
|
|
|
|
for (; l; l = l->next) {
|
|
|
|
Area *child = l->data;
|
2016-03-25 10:12:26 +00:00
|
|
|
if (!child->on_screen || child->width == 0 || child->height == 0)
|
2016-03-25 09:08:24 +00:00
|
|
|
continue;
|
|
|
|
node = child;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean area_is_last(void *obj)
|
|
|
|
{
|
|
|
|
Area *a = obj;
|
|
|
|
if (!a->on_screen)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
Panel *panel = a->panel;
|
|
|
|
|
|
|
|
Area *node = &panel->area;
|
|
|
|
|
|
|
|
while (node) {
|
2016-03-25 10:12:26 +00:00
|
|
|
if (!node->on_screen || node->width == 0 || node->height == 0)
|
2016-03-25 09:08:24 +00:00
|
|
|
return FALSE;
|
|
|
|
if (node == a)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
GList *l = node->children;
|
|
|
|
node = NULL;
|
|
|
|
for (; l; l = l->next) {
|
|
|
|
Area *child = l->data;
|
2016-03-25 10:12:26 +00:00
|
|
|
if (!child->on_screen || child->width == 0 || child->height == 0)
|
2016-03-25 09:08:24 +00:00
|
|
|
continue;
|
|
|
|
node = child;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2016-02-27 12:41:36 +00:00
|
|
|
gboolean area_is_under_mouse(void *obj, int x, int y)
|
|
|
|
{
|
|
|
|
Area *a = obj;
|
2016-03-25 10:12:26 +00:00
|
|
|
if (!a->on_screen || a->width == 0 || a->height == 0)
|
2016-02-27 12:41:36 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (a->_is_under_mouse)
|
|
|
|
return a->_is_under_mouse(a, x, y);
|
|
|
|
|
|
|
|
return x >= a->posx && x <= (a->posx + a->width) && y >= a->posy && y <= (a->posy + a->height);
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean full_width_area_is_under_mouse(void *obj, int x, int y)
|
|
|
|
{
|
|
|
|
Area *a = obj;
|
|
|
|
if (!a->on_screen)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (a->_is_under_mouse && a->_is_under_mouse != full_width_area_is_under_mouse)
|
|
|
|
return a->_is_under_mouse(a, x, y);
|
|
|
|
|
|
|
|
if (panel_horizontal)
|
2016-03-28 18:26:47 +00:00
|
|
|
return (x >= a->posx) && (x <= a->posx + a->width);
|
2016-02-27 12:41:36 +00:00
|
|
|
else
|
2016-03-28 18:26:47 +00:00
|
|
|
return (y >= a->posy) && (y <= a->posy + a->height);
|
2016-02-27 12:41:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Area *find_area_under_mouse(void *root, int x, int y)
|
|
|
|
{
|
|
|
|
Area *result = root;
|
|
|
|
Area *new_result = result;
|
|
|
|
do {
|
|
|
|
result = new_result;
|
|
|
|
GList *it = result->children;
|
|
|
|
while (it) {
|
|
|
|
Area *a = (Area *)it->data;
|
|
|
|
if (area_is_under_mouse(a, x, y)) {
|
|
|
|
new_result = a;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
it = it->next;
|
|
|
|
}
|
|
|
|
} while (new_result != result);
|
|
|
|
return result;
|
|
|
|
}
|
2016-05-21 13:14:57 +00:00
|
|
|
|
|
|
|
int left_border_width(Area *a)
|
|
|
|
{
|
|
|
|
return left_bg_border_width(a->bg);
|
|
|
|
}
|
|
|
|
|
|
|
|
int right_border_width(Area *a)
|
|
|
|
{
|
|
|
|
return right_bg_border_width(a->bg);
|
|
|
|
}
|
|
|
|
|
|
|
|
int top_border_width(Area *a)
|
|
|
|
{
|
|
|
|
return top_bg_border_width(a->bg);
|
|
|
|
}
|
|
|
|
|
|
|
|
int bottom_border_width(Area *a)
|
|
|
|
{
|
|
|
|
return bottom_bg_border_width(a->bg);
|
|
|
|
}
|
|
|
|
|
|
|
|
int left_right_border_width(Area *a)
|
|
|
|
{
|
|
|
|
return left_right_bg_border_width(a->bg);
|
|
|
|
}
|
|
|
|
|
|
|
|
int top_bottom_border_width(Area *a)
|
|
|
|
{
|
|
|
|
return top_bottom_bg_border_width(a->bg);
|
|
|
|
}
|
|
|
|
|
|
|
|
int bg_border_width(Background *bg, int mask)
|
|
|
|
{
|
|
|
|
return bg->border.mask & mask ? bg->border.width : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int left_bg_border_width(Background *bg)
|
|
|
|
{
|
|
|
|
return bg_border_width(bg, BORDER_LEFT);
|
|
|
|
}
|
|
|
|
|
|
|
|
int top_bg_border_width(Background *bg)
|
|
|
|
{
|
|
|
|
return bg_border_width(bg, BORDER_TOP);
|
|
|
|
}
|
|
|
|
|
|
|
|
int right_bg_border_width(Background *bg)
|
|
|
|
{
|
|
|
|
return bg_border_width(bg, BORDER_RIGHT);
|
|
|
|
}
|
|
|
|
|
|
|
|
int bottom_bg_border_width(Background *bg)
|
|
|
|
{
|
|
|
|
return bg_border_width(bg, BORDER_BOTTOM);
|
|
|
|
}
|
|
|
|
|
|
|
|
int left_right_bg_border_width(Background *bg)
|
|
|
|
{
|
|
|
|
return left_bg_border_width(bg) + right_bg_border_width(bg);
|
|
|
|
}
|
|
|
|
|
|
|
|
int top_bottom_bg_border_width(Background *bg)
|
|
|
|
{
|
|
|
|
return top_bg_border_width(bg) + bottom_bg_border_width(bg);
|
|
|
|
}
|