[6d5e378] | 1 | /*
|
---|
| 2 | * Copyright (c) 2012 Petr Koupy
|
---|
| 3 | * All rights reserved.
|
---|
| 4 | *
|
---|
| 5 | * Redistribution and use in source and binary forms, with or without
|
---|
| 6 | * modification, are permitted provided that the following conditions
|
---|
| 7 | * are met:
|
---|
| 8 | *
|
---|
| 9 | * - Redistributions of source code must retain the above copyright
|
---|
| 10 | * notice, this list of conditions and the following disclaimer.
|
---|
| 11 | * - Redistributions in binary form must reproduce the above copyright
|
---|
| 12 | * notice, this list of conditions and the following disclaimer in the
|
---|
| 13 | * documentation and/or other materials provided with the distribution.
|
---|
| 14 | * - The name of the author may not be used to endorse or promote products
|
---|
| 15 | * derived from this software without specific prior written permission.
|
---|
| 16 | *
|
---|
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
| 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 27 | */
|
---|
| 28 |
|
---|
| 29 | /** @addtogroup gui
|
---|
| 30 | * @{
|
---|
| 31 | */
|
---|
| 32 | /**
|
---|
| 33 | * @file
|
---|
| 34 | */
|
---|
| 35 |
|
---|
[3e6a98c5] | 36 | #include <stdbool.h>
|
---|
[6d5e378] | 37 | #include <errno.h>
|
---|
| 38 | #include <stdio.h>
|
---|
[c23275a] | 39 | #include <stdlib.h>
|
---|
[6d5e378] | 40 |
|
---|
| 41 | #include <as.h>
|
---|
[38d150e] | 42 | #include <stdlib.h>
|
---|
[6d5e378] | 43 | #include <str.h>
|
---|
| 44 |
|
---|
| 45 | #include <fibril.h>
|
---|
| 46 | #include <task.h>
|
---|
| 47 | #include <adt/prodcons.h>
|
---|
| 48 | #include <adt/list.h>
|
---|
| 49 |
|
---|
| 50 | #include <loc.h>
|
---|
| 51 |
|
---|
| 52 | #include <io/pixel.h>
|
---|
[2bb6d04] | 53 | #include <draw/source.h>
|
---|
| 54 | #include <draw/font.h>
|
---|
| 55 | #include <draw/drawctx.h>
|
---|
| 56 | #include <draw/surface.h>
|
---|
[4645b2c] | 57 | #include <display.h>
|
---|
[6d5e378] | 58 |
|
---|
[296e124e] | 59 | #include "common.h"
|
---|
[6d5e378] | 60 | #include "connection.h"
|
---|
| 61 | #include "widget.h"
|
---|
| 62 | #include "window.h"
|
---|
| 63 |
|
---|
[296e124e] | 64 | static sysarg_t border_thickness = 4;
|
---|
| 65 | static sysarg_t bevel_thickness = 1;
|
---|
[61b5b73d] | 66 | static sysarg_t header_height = 20;
|
---|
[6d5e378] | 67 | static sysarg_t header_min_width = 40;
|
---|
[61b5b73d] | 68 | static sysarg_t close_thickness = 20;
|
---|
[6d5e378] | 69 |
|
---|
[296e124e] | 70 | static pixel_t color_highlight = PIXEL(255, 255, 255, 255);
|
---|
| 71 | static pixel_t color_shadow = PIXEL(255, 85, 85, 85);
|
---|
| 72 | static pixel_t color_surface = PIXEL(255, 186, 186, 186);
|
---|
[6d5e378] | 73 |
|
---|
[296e124e] | 74 | static pixel_t color_header_focus_highlight = PIXEL(255, 120, 145, 255);
|
---|
| 75 | static pixel_t color_header_focus_shadow = PIXEL(255, 40, 48, 89);
|
---|
| 76 | static pixel_t color_header_focus_surface = PIXEL(255, 88, 106, 196);
|
---|
[6d5e378] | 77 |
|
---|
[296e124e] | 78 | static pixel_t color_header_unfocus_highlight = PIXEL(255, 16, 78, 126);
|
---|
| 79 | static pixel_t color_header_unfocus_shadow = PIXEL(255, 5, 26, 42);
|
---|
| 80 | static pixel_t color_header_unfocus_surface = PIXEL(255, 12, 57, 92);
|
---|
[6d5e378] | 81 |
|
---|
[296e124e] | 82 | static pixel_t color_caption_focus = PIXEL(255, 255, 255, 255);
|
---|
| 83 | static pixel_t color_caption_unfocus = PIXEL(255, 207, 207, 207);
|
---|
| 84 |
|
---|
[287688f2] | 85 | static void window_kbd_event(void *, kbd_event_t *);
|
---|
[f7fb2b21] | 86 | static void window_pos_event(void *, pos_event_t *);
|
---|
[287688f2] | 87 |
|
---|
| 88 | static display_wnd_cb_t window_cb = {
|
---|
[f7fb2b21] | 89 | .kbd_event = window_kbd_event,
|
---|
| 90 | .pos_event = window_pos_event
|
---|
[287688f2] | 91 | };
|
---|
| 92 |
|
---|
[296e124e] | 93 | static void paint_internal(widget_t *widget)
|
---|
| 94 | {
|
---|
| 95 | surface_t *surface = window_claim(widget->window);
|
---|
| 96 | if (!surface)
|
---|
| 97 | window_yield(widget->window);
|
---|
[a35b458] | 98 |
|
---|
[296e124e] | 99 | source_t source;
|
---|
[6d5e378] | 100 | source_init(&source);
|
---|
[a35b458] | 101 |
|
---|
[296e124e] | 102 | drawctx_t drawctx;
|
---|
[6d5e378] | 103 | drawctx_init(&drawctx, surface);
|
---|
| 104 | drawctx_set_source(&drawctx, &source);
|
---|
[a35b458] | 105 |
|
---|
[296e124e] | 106 | /* Window border outer bevel */
|
---|
[a35b458] | 107 |
|
---|
[296e124e] | 108 | draw_bevel(&drawctx, &source, widget->vpos, widget->hpos,
|
---|
| 109 | widget->width, widget->height, color_highlight, color_shadow);
|
---|
[a35b458] | 110 |
|
---|
[296e124e] | 111 | /* Window border surface */
|
---|
[a35b458] | 112 |
|
---|
[296e124e] | 113 | source_set_color(&source, color_surface);
|
---|
| 114 | drawctx_transfer(&drawctx, widget->hpos + 1, widget->vpos + 1,
|
---|
| 115 | widget->width - 2, 2);
|
---|
| 116 | drawctx_transfer(&drawctx, widget->hpos + 1, widget->vpos + 1,
|
---|
| 117 | 2, widget->height - 2);
|
---|
| 118 | drawctx_transfer(&drawctx, widget->hpos + 1,
|
---|
| 119 | widget->vpos + widget->height - 3, widget->width - 2, 2);
|
---|
| 120 | drawctx_transfer(&drawctx, widget->hpos + widget->width - 3,
|
---|
| 121 | widget->vpos + 1, 2, widget->height - 4);
|
---|
[a35b458] | 122 |
|
---|
[296e124e] | 123 | /* Window border inner bevel */
|
---|
[a35b458] | 124 |
|
---|
[296e124e] | 125 | draw_bevel(&drawctx, &source, widget->hpos + 3, widget->vpos + 3,
|
---|
| 126 | widget->width - 6, widget->height - 6, color_shadow,
|
---|
| 127 | color_highlight);
|
---|
[a35b458] | 128 |
|
---|
[296e124e] | 129 | /* Header bevel */
|
---|
[a35b458] | 130 |
|
---|
[296e124e] | 131 | sysarg_t header_hpos = widget->hpos + border_thickness;
|
---|
| 132 | sysarg_t header_vpos = widget->vpos + border_thickness;
|
---|
| 133 | sysarg_t header_width = widget->width - 2 * border_thickness -
|
---|
| 134 | close_thickness;
|
---|
[a35b458] | 135 |
|
---|
[296e124e] | 136 | draw_bevel(&drawctx, &source, header_hpos, header_vpos,
|
---|
| 137 | header_width, header_height, widget->window->is_focused ?
|
---|
| 138 | color_header_focus_highlight : color_header_unfocus_highlight,
|
---|
| 139 | widget->window->is_focused ?
|
---|
| 140 | color_header_focus_shadow : color_header_unfocus_shadow);
|
---|
[a35b458] | 141 |
|
---|
[296e124e] | 142 | /* Header surface */
|
---|
[a35b458] | 143 |
|
---|
[296e124e] | 144 | source_set_color(&source, widget->window->is_focused ?
|
---|
| 145 | color_header_focus_surface : color_header_unfocus_surface);
|
---|
| 146 | drawctx_transfer(&drawctx, header_hpos + 1, header_vpos + 1,
|
---|
| 147 | header_width - 2, header_height - 2);
|
---|
[a35b458] | 148 |
|
---|
[296e124e] | 149 | /* Close button bevel */
|
---|
[a35b458] | 150 |
|
---|
[296e124e] | 151 | sysarg_t close_hpos = widget->hpos + widget->width -
|
---|
| 152 | border_thickness - close_thickness;
|
---|
| 153 | sysarg_t close_vpos = widget->vpos + border_thickness;
|
---|
[a35b458] | 154 |
|
---|
[296e124e] | 155 | draw_bevel(&drawctx, &source, close_hpos, close_vpos,
|
---|
| 156 | close_thickness, close_thickness, color_highlight, color_shadow);
|
---|
[a35b458] | 157 |
|
---|
[296e124e] | 158 | /* Close button surface */
|
---|
[a35b458] | 159 |
|
---|
[296e124e] | 160 | source_set_color(&source, color_surface);
|
---|
| 161 | drawctx_transfer(&drawctx, close_hpos + 1, close_vpos + 1,
|
---|
| 162 | close_thickness - 2, close_thickness - 2);
|
---|
[a35b458] | 163 |
|
---|
[296e124e] | 164 | /* Close button icon */
|
---|
[a35b458] | 165 |
|
---|
[61b5b73d] | 166 | draw_icon_cross(surface, close_hpos + 3, close_vpos + 3,
|
---|
| 167 | color_highlight, color_shadow);
|
---|
[a35b458] | 168 |
|
---|
[296e124e] | 169 | /* Window caption */
|
---|
[a35b458] | 170 |
|
---|
[2cc1ec0] | 171 | font_t *font;
|
---|
[b7fd2a0] | 172 | errno_t rc = embedded_font_create(&font, 16);
|
---|
[2cc1ec0] | 173 | if (rc != EOK) {
|
---|
| 174 | window_yield(widget->window);
|
---|
| 175 | return;
|
---|
| 176 | }
|
---|
[a35b458] | 177 |
|
---|
[2cc1ec0] | 178 | drawctx_set_font(&drawctx, font);
|
---|
[296e124e] | 179 | source_set_color(&source, widget->window->is_focused ?
|
---|
| 180 | color_caption_focus : color_caption_unfocus);
|
---|
[a35b458] | 181 |
|
---|
[6d5e378] | 182 | sysarg_t cpt_width;
|
---|
| 183 | sysarg_t cpt_height;
|
---|
[2cc1ec0] | 184 | font_get_box(font, widget->window->caption, &cpt_width, &cpt_height);
|
---|
[a35b458] | 185 |
|
---|
[296e124e] | 186 | bool draw_title =
|
---|
| 187 | (widget->width >= 2 * border_thickness + 2 * bevel_thickness +
|
---|
| 188 | close_thickness + cpt_width);
|
---|
[6d5e378] | 189 | if (draw_title) {
|
---|
[296e124e] | 190 | sysarg_t cpt_x = ((widget->width - cpt_width) / 2) + widget->hpos;
|
---|
| 191 | sysarg_t cpt_y = ((header_height - cpt_height) / 2) +
|
---|
| 192 | widget->vpos + border_thickness;
|
---|
[a35b458] | 193 |
|
---|
[296e124e] | 194 | if (widget->window->caption)
|
---|
| 195 | drawctx_print(&drawctx, widget->window->caption, cpt_x, cpt_y);
|
---|
[6d5e378] | 196 | }
|
---|
[a35b458] | 197 |
|
---|
[2cc1ec0] | 198 | font_release(font);
|
---|
[296e124e] | 199 | window_yield(widget->window);
|
---|
[6d5e378] | 200 | }
|
---|
| 201 |
|
---|
| 202 | static void root_destroy(widget_t *widget)
|
---|
| 203 | {
|
---|
| 204 | widget_deinit(widget);
|
---|
| 205 | }
|
---|
| 206 |
|
---|
| 207 | static void root_reconfigure(widget_t *widget)
|
---|
| 208 | {
|
---|
| 209 | if (widget->window->is_decorated) {
|
---|
[feeac0d] | 210 | list_foreach(widget->children, link, widget_t, child) {
|
---|
[296e124e] | 211 | child->rearrange(child,
|
---|
[6d5e378] | 212 | widget->hpos + border_thickness,
|
---|
| 213 | widget->vpos + border_thickness + header_height,
|
---|
| 214 | widget->width - 2 * border_thickness,
|
---|
| 215 | widget->height - 2 * border_thickness - header_height);
|
---|
| 216 | }
|
---|
| 217 | } else {
|
---|
[feeac0d] | 218 | list_foreach(widget->children, link, widget_t, child) {
|
---|
[6d5e378] | 219 | child->rearrange(child, widget->hpos, widget->vpos,
|
---|
| 220 | widget->width, widget->height);
|
---|
| 221 | }
|
---|
| 222 | }
|
---|
| 223 | }
|
---|
| 224 |
|
---|
| 225 | static void root_rearrange(widget_t *widget, sysarg_t hpos, sysarg_t vpos,
|
---|
| 226 | sysarg_t width, sysarg_t height)
|
---|
| 227 | {
|
---|
| 228 | widget_modify(widget, hpos, vpos, width, height);
|
---|
| 229 | if (widget->window->is_decorated) {
|
---|
| 230 | paint_internal(widget);
|
---|
[feeac0d] | 231 | list_foreach(widget->children, link, widget_t, child) {
|
---|
[1b20da0] | 232 | child->rearrange(child,
|
---|
[6d5e378] | 233 | hpos + border_thickness,
|
---|
| 234 | vpos + border_thickness + header_height,
|
---|
| 235 | width - 2 * border_thickness,
|
---|
| 236 | height - 2 * border_thickness - header_height);
|
---|
| 237 | }
|
---|
| 238 | } else {
|
---|
[feeac0d] | 239 | list_foreach(widget->children, link, widget_t, child) {
|
---|
[6d5e378] | 240 | child->rearrange(child, hpos, vpos, width, height);
|
---|
| 241 | }
|
---|
| 242 | }
|
---|
| 243 | }
|
---|
| 244 |
|
---|
| 245 | static void root_repaint(widget_t *widget)
|
---|
| 246 | {
|
---|
| 247 | if (widget->window->is_decorated) {
|
---|
| 248 | paint_internal(widget);
|
---|
| 249 | }
|
---|
[feeac0d] | 250 | list_foreach(widget->children, link, widget_t, child) {
|
---|
[6d5e378] | 251 | child->repaint(child);
|
---|
| 252 | }
|
---|
| 253 | if (widget->window->is_decorated) {
|
---|
| 254 | window_damage(widget->window);
|
---|
| 255 | }
|
---|
| 256 | }
|
---|
| 257 |
|
---|
| 258 | static void root_handle_keyboard_event(widget_t *widget, kbd_event_t event)
|
---|
| 259 | {
|
---|
| 260 | if (!list_empty(&widget->children)) {
|
---|
| 261 | widget_t *child = (widget_t *) list_first(&widget->children);
|
---|
| 262 | child->handle_keyboard_event(child, event);
|
---|
| 263 | }
|
---|
| 264 | }
|
---|
| 265 |
|
---|
| 266 | static void root_handle_position_event(widget_t *widget, pos_event_t event)
|
---|
| 267 | {
|
---|
| 268 | if (widget->window->is_decorated) {
|
---|
| 269 | sysarg_t width = widget->width;
|
---|
| 270 | sysarg_t height = widget->height;
|
---|
| 271 |
|
---|
| 272 | bool btn_left = (event.btn_num == 1) && (event.type == POS_PRESS);
|
---|
| 273 | bool btn_right = (event.btn_num == 2) && (event.type == POS_PRESS);
|
---|
| 274 | bool allowed_button = btn_left || btn_right;
|
---|
| 275 |
|
---|
| 276 | bool left = (event.hpos < border_thickness);
|
---|
| 277 | bool right = (event.hpos >= width - border_thickness);
|
---|
| 278 | bool top = (event.vpos < border_thickness);
|
---|
| 279 | bool bottom = (event.vpos >= height - border_thickness);
|
---|
| 280 | bool header = (event.hpos >= border_thickness) &&
|
---|
| 281 | (event.hpos < width - border_thickness) &&
|
---|
| 282 | (event.vpos >= border_thickness) &&
|
---|
| 283 | (event.vpos < border_thickness + header_height);
|
---|
[296e124e] | 284 | bool close = (header) &&
|
---|
| 285 | (event.hpos >= width - border_thickness - close_thickness);
|
---|
[6d5e378] | 286 |
|
---|
| 287 | if (top && left && allowed_button) {
|
---|
| 288 | window_grab_flags_t flags = GF_EMPTY;
|
---|
| 289 | flags |= GF_MOVE_X;
|
---|
| 290 | flags |= GF_MOVE_Y;
|
---|
| 291 | flags |= btn_left ? GF_RESIZE_X : GF_SCALE_X;
|
---|
| 292 | flags |= btn_left ? GF_RESIZE_Y : GF_SCALE_Y;
|
---|
[4645b2c] | 293 | //win_grab(widget->window->osess, event.pos_id, flags);
|
---|
[6d5e378] | 294 | } else if (bottom && left && allowed_button) {
|
---|
| 295 | window_grab_flags_t flags = GF_EMPTY;
|
---|
| 296 | flags |= GF_MOVE_X;
|
---|
| 297 | flags |= btn_left ? GF_RESIZE_X : GF_SCALE_X;
|
---|
| 298 | flags |= btn_left ? GF_RESIZE_Y : GF_SCALE_Y;
|
---|
[4645b2c] | 299 | //win_grab(widget->window->osess, event.pos_id, flags);
|
---|
[6d5e378] | 300 | } else if (bottom && right && allowed_button) {
|
---|
| 301 | window_grab_flags_t flags = GF_EMPTY;
|
---|
| 302 | flags |= btn_left ? GF_RESIZE_X : GF_SCALE_X;
|
---|
| 303 | flags |= btn_left ? GF_RESIZE_Y : GF_SCALE_Y;
|
---|
[4645b2c] | 304 | //win_grab(widget->window->osess, event.pos_id, flags);
|
---|
[6d5e378] | 305 | } else if (top && right && allowed_button) {
|
---|
| 306 | window_grab_flags_t flags = GF_EMPTY;
|
---|
| 307 | flags |= GF_MOVE_Y;
|
---|
| 308 | flags |= btn_left ? GF_RESIZE_X : GF_SCALE_X;
|
---|
| 309 | flags |= btn_left ? GF_RESIZE_Y : GF_SCALE_Y;
|
---|
[4645b2c] | 310 | //win_grab(widget->window->osess, event.pos_id, flags);
|
---|
[6d5e378] | 311 | } else if (top && allowed_button) {
|
---|
| 312 | window_grab_flags_t flags = GF_EMPTY;
|
---|
| 313 | flags |= GF_MOVE_Y;
|
---|
| 314 | flags |= btn_left ? GF_RESIZE_Y : GF_SCALE_Y;
|
---|
[4645b2c] | 315 | //win_grab(widget->window->osess, event.pos_id, flags);
|
---|
[6d5e378] | 316 | } else if (left && allowed_button) {
|
---|
| 317 | window_grab_flags_t flags = GF_EMPTY;
|
---|
| 318 | flags |= GF_MOVE_X;
|
---|
| 319 | flags |= btn_left ? GF_RESIZE_X : GF_SCALE_X;
|
---|
[4645b2c] | 320 | //win_grab(widget->window->osess, event.pos_id, flags);
|
---|
[6d5e378] | 321 | } else if (bottom && allowed_button) {
|
---|
| 322 | window_grab_flags_t flags = GF_EMPTY;
|
---|
| 323 | flags |= btn_left ? GF_RESIZE_Y : GF_SCALE_Y;
|
---|
[4645b2c] | 324 | //win_grab(widget->window->osess, event.pos_id, flags);
|
---|
[6d5e378] | 325 | } else if (right && allowed_button) {
|
---|
| 326 | window_grab_flags_t flags = GF_EMPTY;
|
---|
| 327 | flags |= btn_left ? GF_RESIZE_X : GF_SCALE_X;
|
---|
[4645b2c] | 328 | //win_grab(widget->window->osess, event.pos_id, flags);
|
---|
[6d5e378] | 329 | } else if (close && btn_left) {
|
---|
[4645b2c] | 330 | //win_close_request(widget->window->osess);
|
---|
[6d5e378] | 331 | } else if (header && btn_left) {
|
---|
| 332 | window_grab_flags_t flags = GF_EMPTY;
|
---|
| 333 | flags |= GF_MOVE_X;
|
---|
| 334 | flags |= GF_MOVE_Y;
|
---|
[4645b2c] | 335 | //win_grab(widget->window->osess, event.pos_id, flags);
|
---|
[6d5e378] | 336 | } else {
|
---|
[feeac0d] | 337 | list_foreach(widget->children, link, widget_t, child) {
|
---|
[6d5e378] | 338 | child->handle_position_event(child, event);
|
---|
| 339 | }
|
---|
| 340 | }
|
---|
| 341 | } else {
|
---|
[feeac0d] | 342 | list_foreach(widget->children, link, widget_t, child) {
|
---|
[6d5e378] | 343 | child->handle_position_event(child, event);
|
---|
| 344 | }
|
---|
| 345 | }
|
---|
| 346 | }
|
---|
| 347 |
|
---|
| 348 | static void deliver_keyboard_event(window_t *win, kbd_event_t event)
|
---|
| 349 | {
|
---|
| 350 | if (win->focus) {
|
---|
| 351 | win->focus->handle_keyboard_event(win->focus, event);
|
---|
| 352 | } else {
|
---|
| 353 | win->root.handle_keyboard_event(&win->root, event);
|
---|
| 354 | }
|
---|
| 355 | }
|
---|
| 356 |
|
---|
| 357 | static void deliver_position_event(window_t *win, pos_event_t event)
|
---|
| 358 | {
|
---|
| 359 | if (win->grab) {
|
---|
| 360 | win->grab->handle_position_event(win->grab, event);
|
---|
| 361 | } else {
|
---|
| 362 | win->root.handle_position_event(&win->root, event);
|
---|
| 363 | }
|
---|
| 364 | }
|
---|
| 365 |
|
---|
[62fbb7e] | 366 | static void handle_signal_event(window_t *win, signal_event_t event)
|
---|
[6d5e378] | 367 | {
|
---|
| 368 | widget_t *widget = (widget_t *) event.object;
|
---|
| 369 | slot_t slot = (slot_t) event.slot;
|
---|
| 370 | void *data = (void *) event.argument;
|
---|
| 371 |
|
---|
| 372 | slot(widget, data);
|
---|
| 373 |
|
---|
| 374 | free(data);
|
---|
| 375 | }
|
---|
| 376 |
|
---|
[62fbb7e] | 377 | static void handle_resize(window_t *win, sysarg_t offset_x, sysarg_t offset_y,
|
---|
| 378 | sysarg_t width, sysarg_t height, window_placement_flags_t placement_flags)
|
---|
[6d5e378] | 379 | {
|
---|
[3275736] | 380 | display_wnd_params_t wparams;
|
---|
| 381 | display_window_t *new_window = NULL;
|
---|
[4645b2c] | 382 | gfx_bitmap_params_t params;
|
---|
| 383 | gfx_bitmap_alloc_t alloc;
|
---|
[3275736] | 384 | gfx_bitmap_t *new_bitmap = NULL;
|
---|
| 385 | gfx_context_t *new_gc = NULL;
|
---|
| 386 | errno_t rc;
|
---|
[4645b2c] | 387 |
|
---|
[6d5e378] | 388 | if (width < 2 * border_thickness + header_min_width) {
|
---|
[4645b2c] | 389 | //win_damage(win->osess, 0, 0, 0, 0);
|
---|
[6d5e378] | 390 | return;
|
---|
| 391 | }
|
---|
[a35b458] | 392 |
|
---|
[6d5e378] | 393 | if (height < 2 * border_thickness + header_height) {
|
---|
[4645b2c] | 394 | //win_damage(win->osess, 0, 0, 0, 0);
|
---|
[6d5e378] | 395 | return;
|
---|
| 396 | }
|
---|
[a35b458] | 397 |
|
---|
[6d5e378] | 398 | /* Allocate resources for new surface. */
|
---|
[62fbb7e] | 399 | surface_t *new_surface = surface_create(width, height, NULL,
|
---|
| 400 | SURFACE_FLAG_SHARED);
|
---|
| 401 | if (!new_surface)
|
---|
[6d5e378] | 402 | return;
|
---|
[a35b458] | 403 |
|
---|
[3275736] | 404 | display_wnd_params_init(&wparams);
|
---|
| 405 | wparams.rect.p0.x = 0;
|
---|
| 406 | wparams.rect.p0.y = 0;
|
---|
| 407 | wparams.rect.p1.x = width;
|
---|
| 408 | wparams.rect.p1.y = height;
|
---|
| 409 |
|
---|
[287688f2] | 410 | rc = display_window_create(win->display, &wparams, &window_cb,
|
---|
| 411 | (void *) win, &new_window);
|
---|
[3275736] | 412 | if (rc != EOK) {
|
---|
| 413 | surface_destroy(new_surface);
|
---|
| 414 | return;
|
---|
| 415 | }
|
---|
| 416 |
|
---|
| 417 | rc = display_window_get_gc(new_window, &new_gc);
|
---|
| 418 | if (rc != EOK) {
|
---|
| 419 | display_window_destroy(new_window);
|
---|
| 420 | surface_destroy(new_surface);
|
---|
| 421 | return;
|
---|
| 422 | }
|
---|
[4645b2c] | 423 |
|
---|
| 424 | params.rect.p0.x = 0;
|
---|
| 425 | params.rect.p0.y = 0;
|
---|
| 426 | params.rect.p1.x = width;
|
---|
| 427 | params.rect.p1.y = height;
|
---|
| 428 |
|
---|
| 429 | alloc.pitch = width * sizeof(uint32_t);
|
---|
| 430 | alloc.off0 = 0;
|
---|
| 431 | alloc.pixels = surface_direct_access(new_surface);
|
---|
| 432 |
|
---|
[3275736] | 433 | rc = gfx_bitmap_create(new_gc, ¶ms, &alloc, &new_bitmap);
|
---|
[4645b2c] | 434 | if (rc != EOK) {
|
---|
[3275736] | 435 | gfx_context_delete(new_gc);
|
---|
| 436 | display_window_destroy(new_window);
|
---|
[4645b2c] | 437 | surface_destroy(new_surface);
|
---|
| 438 | return;
|
---|
| 439 | }
|
---|
| 440 |
|
---|
[6d5e378] | 441 | /* Switch new and old surface. */
|
---|
| 442 | fibril_mutex_lock(&win->guard);
|
---|
[62fbb7e] | 443 | surface_t *old_surface = win->surface;
|
---|
[4645b2c] | 444 | gfx_bitmap_t *old_bitmap = win->bitmap;
|
---|
[3275736] | 445 | display_window_t *old_window = win->dwindow;
|
---|
| 446 | gfx_context_t *old_gc = win->gc;
|
---|
[6d5e378] | 447 | win->surface = new_surface;
|
---|
[4645b2c] | 448 | win->bitmap = new_bitmap;
|
---|
[3275736] | 449 | win->dwindow = new_window;
|
---|
| 450 | win->gc = new_gc;
|
---|
[6d5e378] | 451 | fibril_mutex_unlock(&win->guard);
|
---|
[a35b458] | 452 |
|
---|
[62fbb7e] | 453 | /*
|
---|
| 454 | * Let all widgets in the tree alter their position and size.
|
---|
| 455 | * Widgets might also paint themselves onto the new surface.
|
---|
| 456 | */
|
---|
[6d5e378] | 457 | win->root.rearrange(&win->root, 0, 0, width, height);
|
---|
[a35b458] | 458 |
|
---|
[6d5e378] | 459 | fibril_mutex_lock(&win->guard);
|
---|
| 460 | surface_reset_damaged_region(win->surface);
|
---|
| 461 | fibril_mutex_unlock(&win->guard);
|
---|
[a35b458] | 462 |
|
---|
[6d5e378] | 463 | /* Inform compositor about new surface. */
|
---|
[4645b2c] | 464 | // errno_t rc = win_resize(win->osess, offset_x, offset_y, width, height,
|
---|
| 465 | // placement_flags, surface_direct_access(new_surface));
|
---|
| 466 | rc = EOK;
|
---|
[a35b458] | 467 |
|
---|
[6d5e378] | 468 | if (rc != EOK) {
|
---|
| 469 | /* Rollback to old surface. Reverse all changes. */
|
---|
[a35b458] | 470 |
|
---|
[6d5e378] | 471 | sysarg_t old_width = 0;
|
---|
| 472 | sysarg_t old_height = 0;
|
---|
[62fbb7e] | 473 | if (old_surface)
|
---|
[6d5e378] | 474 | surface_get_resolution(old_surface, &old_width, &old_height);
|
---|
[a35b458] | 475 |
|
---|
[6d5e378] | 476 | fibril_mutex_lock(&win->guard);
|
---|
| 477 | new_surface = win->surface;
|
---|
| 478 | win->surface = old_surface;
|
---|
[3275736] | 479 | win->bitmap = old_bitmap;
|
---|
| 480 | win->dwindow = old_window;
|
---|
| 481 | win->gc = old_gc;
|
---|
[6d5e378] | 482 | fibril_mutex_unlock(&win->guard);
|
---|
[a35b458] | 483 |
|
---|
[6d5e378] | 484 | win->root.rearrange(&win->root, 0, 0, old_width, old_height);
|
---|
[a35b458] | 485 |
|
---|
[6d5e378] | 486 | if (win->surface) {
|
---|
| 487 | fibril_mutex_lock(&win->guard);
|
---|
| 488 | surface_reset_damaged_region(win->surface);
|
---|
| 489 | fibril_mutex_unlock(&win->guard);
|
---|
| 490 | }
|
---|
[a35b458] | 491 |
|
---|
[6d5e378] | 492 | surface_destroy(new_surface);
|
---|
[62fbb7e] | 493 | } else {
|
---|
[3275736] | 494 | if (old_window != NULL)
|
---|
| 495 | display_window_destroy(old_window);
|
---|
| 496 | if (old_gc != NULL)
|
---|
| 497 | gfx_context_delete(old_gc);
|
---|
[4645b2c] | 498 | if (old_bitmap != NULL)
|
---|
| 499 | gfx_bitmap_destroy(old_bitmap);
|
---|
[62fbb7e] | 500 | /* Deallocate old surface. */
|
---|
| 501 | if (old_surface)
|
---|
| 502 | surface_destroy(old_surface);
|
---|
[4645b2c] | 503 |
|
---|
| 504 | (void) gfx_bitmap_render(win->bitmap, NULL, NULL);
|
---|
[6d5e378] | 505 | }
|
---|
| 506 | }
|
---|
| 507 |
|
---|
| 508 | static void handle_refresh(window_t *win)
|
---|
| 509 | {
|
---|
| 510 | win->root.repaint(&win->root);
|
---|
| 511 | }
|
---|
| 512 |
|
---|
| 513 | static void handle_damage(window_t *win)
|
---|
| 514 | {
|
---|
| 515 | sysarg_t x, y, width, height;
|
---|
[4645b2c] | 516 | gfx_rect_t rect;
|
---|
[6d5e378] | 517 | fibril_mutex_lock(&win->guard);
|
---|
| 518 | surface_get_damaged_region(win->surface, &x, &y, &width, &height);
|
---|
| 519 | surface_reset_damaged_region(win->surface);
|
---|
| 520 | fibril_mutex_unlock(&win->guard);
|
---|
| 521 |
|
---|
[4645b2c] | 522 |
|
---|
[6d5e378] | 523 | if (width > 0 && height > 0) {
|
---|
| 524 | /* Notify compositor. */
|
---|
[4645b2c] | 525 | //win_damage(win->osess, x, y, width, height);
|
---|
| 526 |
|
---|
| 527 | rect.p0.x = x;
|
---|
| 528 | rect.p0.y = y;
|
---|
| 529 | rect.p1.x = x + width;
|
---|
| 530 | rect.p1.y = y + height;
|
---|
| 531 |
|
---|
| 532 | printf("render damaged region: %d,%d,%d,%d,\n",
|
---|
| 533 | (int)x,(int)y,(int)width,(int)height);
|
---|
[3275736] | 534 | if (win->bitmap != NULL)
|
---|
| 535 | (void) gfx_bitmap_render(win->bitmap, &rect, NULL);
|
---|
[6d5e378] | 536 | }
|
---|
| 537 | }
|
---|
| 538 |
|
---|
| 539 | static void destroy_children(widget_t *widget)
|
---|
| 540 | {
|
---|
| 541 | /* Recursively destroy widget tree in bottom-top order. */
|
---|
| 542 | while (!list_empty(&widget->children)) {
|
---|
| 543 | widget_t *child =
|
---|
| 544 | list_get_instance(list_first(&widget->children), widget_t, link);
|
---|
| 545 | destroy_children(child);
|
---|
| 546 | child->destroy(child);
|
---|
| 547 | }
|
---|
| 548 | }
|
---|
| 549 |
|
---|
| 550 | static void handle_close(window_t *win)
|
---|
| 551 | {
|
---|
| 552 | destroy_children(&win->root);
|
---|
| 553 | win->root.destroy(&win->root);
|
---|
| 554 | win->grab = NULL;
|
---|
| 555 | win->focus = NULL;
|
---|
| 556 |
|
---|
[4645b2c] | 557 | display_window_destroy(win->dwindow);
|
---|
| 558 | display_close(win->display);
|
---|
[6d5e378] | 559 |
|
---|
| 560 | while (!list_empty(&win->events.list)) {
|
---|
[21eeb653] | 561 | window_event_t *event = (window_event_t *) list_first(&win->events.list);
|
---|
| 562 | list_remove(&event->link);
|
---|
| 563 | free(event);
|
---|
[6d5e378] | 564 | }
|
---|
| 565 |
|
---|
| 566 | if (win->surface) {
|
---|
| 567 | surface_destroy(win->surface);
|
---|
| 568 | }
|
---|
| 569 |
|
---|
| 570 | free(win->caption);
|
---|
| 571 |
|
---|
| 572 | free(win);
|
---|
| 573 | }
|
---|
| 574 |
|
---|
| 575 | /* Window event loop. Runs in own dedicated fibril. */
|
---|
[b7fd2a0] | 576 | static errno_t event_loop(void *arg)
|
---|
[6d5e378] | 577 | {
|
---|
| 578 | bool is_main = false;
|
---|
| 579 | bool terminate = false;
|
---|
| 580 | window_t *win = (window_t *) arg;
|
---|
| 581 |
|
---|
| 582 | while (true) {
|
---|
| 583 | window_event_t *event = (window_event_t *) prodcons_consume(&win->events);
|
---|
| 584 |
|
---|
| 585 | switch (event->type) {
|
---|
| 586 | case ET_KEYBOARD_EVENT:
|
---|
| 587 | deliver_keyboard_event(win, event->data.kbd);
|
---|
| 588 | break;
|
---|
| 589 | case ET_POSITION_EVENT:
|
---|
[290a0f0] | 590 | if (!win->is_focused) {
|
---|
| 591 | win->is_focused = true;
|
---|
| 592 | handle_refresh(win);
|
---|
| 593 | }
|
---|
[6d5e378] | 594 | deliver_position_event(win, event->data.pos);
|
---|
| 595 | break;
|
---|
| 596 | case ET_SIGNAL_EVENT:
|
---|
[62fbb7e] | 597 | handle_signal_event(win, event->data.signal);
|
---|
[6d5e378] | 598 | break;
|
---|
| 599 | case ET_WINDOW_RESIZE:
|
---|
[62fbb7e] | 600 | handle_resize(win, event->data.resize.offset_x,
|
---|
| 601 | event->data.resize.offset_y, event->data.resize.width,
|
---|
| 602 | event->data.resize.height, event->data.resize.placement_flags);
|
---|
[6d5e378] | 603 | break;
|
---|
[290a0f0] | 604 | case ET_WINDOW_FOCUS:
|
---|
| 605 | if (!win->is_focused) {
|
---|
| 606 | win->is_focused = true;
|
---|
| 607 | handle_refresh(win);
|
---|
| 608 | }
|
---|
| 609 | break;
|
---|
| 610 | case ET_WINDOW_UNFOCUS:
|
---|
| 611 | if (win->is_focused) {
|
---|
| 612 | win->is_focused = false;
|
---|
| 613 | handle_refresh(win);
|
---|
| 614 | }
|
---|
| 615 | break;
|
---|
[6d5e378] | 616 | case ET_WINDOW_REFRESH:
|
---|
| 617 | handle_refresh(win);
|
---|
| 618 | break;
|
---|
| 619 | case ET_WINDOW_DAMAGE:
|
---|
| 620 | handle_damage(win);
|
---|
| 621 | break;
|
---|
| 622 | case ET_WINDOW_CLOSE:
|
---|
| 623 | is_main = win->is_main;
|
---|
| 624 | handle_close(win);
|
---|
| 625 | terminate = true;
|
---|
| 626 | break;
|
---|
| 627 | default:
|
---|
| 628 | break;
|
---|
| 629 | }
|
---|
| 630 |
|
---|
| 631 | free(event);
|
---|
| 632 | if (terminate) {
|
---|
| 633 | break;
|
---|
| 634 | }
|
---|
| 635 | }
|
---|
| 636 |
|
---|
| 637 | if (is_main) {
|
---|
| 638 | exit(0); /* Terminate whole task. */
|
---|
| 639 | }
|
---|
| 640 | return 0;
|
---|
| 641 | }
|
---|
| 642 |
|
---|
| 643 | /* Input fetcher from compositor. Runs in own dedicated fibril. */
|
---|
[b7fd2a0] | 644 | static errno_t fetch_input(void *arg)
|
---|
[6d5e378] | 645 | {
|
---|
[4645b2c] | 646 | // errno_t rc;
|
---|
| 647 | // bool terminate = false;
|
---|
| 648 | // window_t *win = (window_t *) arg;
|
---|
[6d5e378] | 649 |
|
---|
[4645b2c] | 650 | /* while (true) {
|
---|
[6d5e378] | 651 | window_event_t *event = (window_event_t *) malloc(sizeof(window_event_t));
|
---|
[a35b458] | 652 |
|
---|
[6d5e378] | 653 | if (event) {
|
---|
| 654 | rc = win_get_event(win->isess, event);
|
---|
| 655 | if (rc == EOK) {
|
---|
| 656 | terminate = (event->type == ET_WINDOW_CLOSE);
|
---|
| 657 | link_initialize(&event->link);
|
---|
| 658 | prodcons_produce(&win->events, &event->link);
|
---|
| 659 | } else {
|
---|
| 660 | free(event);
|
---|
| 661 | terminate = true;
|
---|
| 662 | }
|
---|
| 663 | } else {
|
---|
| 664 | terminate = true;
|
---|
| 665 | }
|
---|
| 666 |
|
---|
| 667 | if (terminate) {
|
---|
| 668 | break;
|
---|
| 669 | }
|
---|
| 670 | }
|
---|
[4645b2c] | 671 | */
|
---|
[6d5e378] | 672 | return 0;
|
---|
| 673 | }
|
---|
| 674 |
|
---|
[10cb47e] | 675 | window_t *window_open(const char *winreg, const void *data,
|
---|
| 676 | window_flags_t flags, const char *caption)
|
---|
[6d5e378] | 677 | {
|
---|
[3275736] | 678 | window_t *win = (window_t *) calloc(1, sizeof(window_t));
|
---|
[ba02baa] | 679 | if (!win)
|
---|
[6d5e378] | 680 | return NULL;
|
---|
[a35b458] | 681 |
|
---|
[2c7fdaa] | 682 | win->is_main = flags & WINDOW_MAIN;
|
---|
| 683 | win->is_decorated = flags & WINDOW_DECORATED;
|
---|
[290a0f0] | 684 | win->is_focused = true;
|
---|
[6d5e378] | 685 | prodcons_initialize(&win->events);
|
---|
| 686 | fibril_mutex_initialize(&win->guard);
|
---|
[a35b458] | 687 |
|
---|
[10cb47e] | 688 | widget_init(&win->root, NULL, data);
|
---|
[6d5e378] | 689 | win->root.window = win;
|
---|
| 690 | win->root.destroy = root_destroy;
|
---|
| 691 | win->root.reconfigure = root_reconfigure;
|
---|
| 692 | win->root.rearrange = root_rearrange;
|
---|
| 693 | win->root.repaint = root_repaint;
|
---|
| 694 | win->root.handle_keyboard_event = root_handle_keyboard_event;
|
---|
| 695 | win->root.handle_position_event = root_handle_position_event;
|
---|
| 696 | win->grab = NULL;
|
---|
| 697 | win->focus = NULL;
|
---|
| 698 | win->surface = NULL;
|
---|
[a35b458] | 699 |
|
---|
[4645b2c] | 700 | errno_t rc = display_open(winreg, &win->display);
|
---|
[6d5e378] | 701 | if (rc != EOK) {
|
---|
| 702 | free(win);
|
---|
| 703 | return NULL;
|
---|
| 704 | }
|
---|
[a35b458] | 705 |
|
---|
| 706 |
|
---|
[ba02baa] | 707 | if (caption == NULL)
|
---|
[6d5e378] | 708 | win->caption = NULL;
|
---|
[ba02baa] | 709 | else
|
---|
[6d5e378] | 710 | win->caption = str_dup(caption);
|
---|
[a35b458] | 711 |
|
---|
[6d5e378] | 712 | return win;
|
---|
| 713 | }
|
---|
| 714 |
|
---|
[62fbb7e] | 715 | void window_resize(window_t *win, sysarg_t offset_x, sysarg_t offset_y,
|
---|
| 716 | sysarg_t width, sysarg_t height, window_placement_flags_t placement_flags)
|
---|
[6d5e378] | 717 | {
|
---|
| 718 | window_event_t *event = (window_event_t *) malloc(sizeof(window_event_t));
|
---|
| 719 | if (event) {
|
---|
| 720 | link_initialize(&event->link);
|
---|
| 721 | event->type = ET_WINDOW_RESIZE;
|
---|
[62fbb7e] | 722 | event->data.resize.offset_x = offset_x;
|
---|
| 723 | event->data.resize.offset_y = offset_y;
|
---|
| 724 | event->data.resize.width = width;
|
---|
| 725 | event->data.resize.height = height;
|
---|
| 726 | event->data.resize.placement_flags = placement_flags;
|
---|
[6d5e378] | 727 | prodcons_produce(&win->events, &event->link);
|
---|
| 728 | }
|
---|
| 729 | }
|
---|
| 730 |
|
---|
[b7fd2a0] | 731 | errno_t window_set_caption(window_t *win, const char *caption)
|
---|
[78188e5] | 732 | {
|
---|
| 733 | char *cap;
|
---|
[a35b458] | 734 |
|
---|
[78188e5] | 735 | if (caption == NULL) {
|
---|
| 736 | win->caption = NULL;
|
---|
| 737 | } else {
|
---|
| 738 | cap = str_dup(caption);
|
---|
| 739 | if (cap == NULL)
|
---|
| 740 | return ENOMEM;
|
---|
| 741 | free(win->caption);
|
---|
| 742 | win->caption = cap;
|
---|
| 743 | }
|
---|
[a35b458] | 744 |
|
---|
[78188e5] | 745 | win->is_focused = false;
|
---|
| 746 | handle_refresh(win);
|
---|
[a35b458] | 747 |
|
---|
[78188e5] | 748 | return EOK;
|
---|
| 749 | }
|
---|
| 750 |
|
---|
[6d5e378] | 751 | void window_refresh(window_t *win)
|
---|
| 752 | {
|
---|
| 753 | window_event_t *event = (window_event_t *) malloc(sizeof(window_event_t));
|
---|
| 754 | if (event) {
|
---|
| 755 | link_initialize(&event->link);
|
---|
| 756 | event->type = ET_WINDOW_REFRESH;
|
---|
| 757 | prodcons_produce(&win->events, &event->link);
|
---|
| 758 | }
|
---|
| 759 | }
|
---|
| 760 |
|
---|
| 761 | void window_damage(window_t *win)
|
---|
| 762 | {
|
---|
| 763 | window_event_t *event = (window_event_t *) malloc(sizeof(window_event_t));
|
---|
| 764 | if (event) {
|
---|
| 765 | link_initialize(&event->link);
|
---|
| 766 | event->type = ET_WINDOW_DAMAGE;
|
---|
| 767 | prodcons_produce(&win->events, &event->link);
|
---|
| 768 | }
|
---|
| 769 | }
|
---|
| 770 |
|
---|
| 771 | widget_t *window_root(window_t *win)
|
---|
| 772 | {
|
---|
| 773 | return &win->root;
|
---|
| 774 | }
|
---|
| 775 |
|
---|
| 776 | void window_exec(window_t *win)
|
---|
| 777 | {
|
---|
| 778 | fid_t ev_fid = fibril_create(event_loop, win);
|
---|
| 779 | fid_t fi_fid = fibril_create(fetch_input, win);
|
---|
| 780 | if (!ev_fid || !fi_fid) {
|
---|
| 781 | return;
|
---|
| 782 | }
|
---|
| 783 | fibril_add_ready(ev_fid);
|
---|
| 784 | fibril_add_ready(fi_fid);
|
---|
| 785 | }
|
---|
| 786 |
|
---|
| 787 | surface_t *window_claim(window_t *win)
|
---|
| 788 | {
|
---|
| 789 | fibril_mutex_lock(&win->guard);
|
---|
| 790 | return win->surface;
|
---|
| 791 | }
|
---|
| 792 |
|
---|
| 793 | void window_yield(window_t *win)
|
---|
| 794 | {
|
---|
| 795 | fibril_mutex_unlock(&win->guard);
|
---|
| 796 | }
|
---|
| 797 |
|
---|
| 798 | void window_close(window_t *win)
|
---|
| 799 | {
|
---|
| 800 | /* Request compositor to init closing cascade. */
|
---|
[4645b2c] | 801 | //win_close_request(win->osess);
|
---|
[6d5e378] | 802 | }
|
---|
| 803 |
|
---|
[287688f2] | 804 | static void window_kbd_event(void *arg, kbd_event_t *kevent)
|
---|
| 805 | {
|
---|
| 806 | window_t *win = (window_t *) arg;
|
---|
| 807 | window_event_t *event;
|
---|
| 808 |
|
---|
| 809 | event = (window_event_t *) calloc(1, sizeof(window_event_t));
|
---|
| 810 | if (event == NULL)
|
---|
| 811 | return;
|
---|
| 812 |
|
---|
| 813 | link_initialize(&event->link);
|
---|
| 814 | event->type = ET_KEYBOARD_EVENT;
|
---|
| 815 | event->data.kbd = *kevent;
|
---|
| 816 | prodcons_produce(&win->events, &event->link);
|
---|
| 817 | }
|
---|
| 818 |
|
---|
[f7fb2b21] | 819 | static void window_pos_event(void *arg, pos_event_t *pevent)
|
---|
| 820 | {
|
---|
| 821 | window_t *win = (window_t *) arg;
|
---|
| 822 | window_event_t *event;
|
---|
| 823 |
|
---|
| 824 | event = (window_event_t *) calloc(1, sizeof(window_event_t));
|
---|
| 825 | if (event == NULL)
|
---|
| 826 | return;
|
---|
| 827 |
|
---|
| 828 | link_initialize(&event->link);
|
---|
| 829 | event->type = ET_POSITION_EVENT;
|
---|
| 830 | event->data.pos = *pevent;
|
---|
| 831 | prodcons_produce(&win->events, &event->link);
|
---|
| 832 | }
|
---|
| 833 |
|
---|
[6d5e378] | 834 | /** @}
|
---|
| 835 | */
|
---|