source: mainline/uspace/lib/ui/include/types/ui/wdecor.h@ 35cffea

ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 35cffea was 35cffea, checked in by Jiri Svoboda <jiri@…>, 4 years ago

Maximizing/unmaximizing a window

  • Property mode set to 100644
File size: 2.9 KB
Line 
1/*
2 * Copyright (c) 2022 Jiri Svoboda
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 libui
30 * @{
31 */
32/**
33 * @file Window decoration
34 */
35
36#ifndef _UI_TYPES_WDECOR_H
37#define _UI_TYPES_WDECOR_H
38
39#include <gfx/coord.h>
40#include <types/ui/cursor.h>
41
42struct ui_wdecor;
43typedef struct ui_wdecor ui_wdecor_t;
44
45/** Window decoration style */
46typedef enum {
47 /** No style bits */
48 ui_wds_none = 0x0,
49 /** Window has a frame */
50 ui_wds_frame = 0x1,
51 /** Window has a title bar */
52 ui_wds_titlebar = 0x2,
53 /** Window has a maximize button */
54 ui_wds_maximize_btn = 0x4,
55 /** Window has a close button */
56 ui_wds_close_btn = 0x8,
57 /** Window is resizable */
58 ui_wds_resizable = 0x10,
59 /** Window is decorated (default decoration) */
60 ui_wds_decorated = ui_wds_frame | ui_wds_titlebar | ui_wds_close_btn
61} ui_wdecor_style_t;
62
63/** Window resize type */
64typedef enum {
65 ui_wr_none = 0,
66
67 ui_wr_top = 0x1,
68 ui_wr_left = 0x2,
69 ui_wr_bottom = 0x4,
70 ui_wr_right = 0x8,
71
72 ui_wr_top_left = ui_wr_top | ui_wr_left,
73 ui_wr_bottom_left = ui_wr_bottom | ui_wr_left,
74 ui_wr_bottom_right = ui_wr_bottom | ui_wr_right,
75 ui_wr_top_right = ui_wr_top | ui_wr_right
76} ui_wdecor_rsztype_t;
77
78/** Window decoration callbacks */
79typedef struct ui_wdecor_cb {
80 void (*maximize)(ui_wdecor_t *, void *);
81 void (*unmaximize)(ui_wdecor_t *, void *);
82 void (*close)(ui_wdecor_t *, void *);
83 void (*move)(ui_wdecor_t *, void *, gfx_coord2_t *);
84 void (*resize)(ui_wdecor_t *, void *, ui_wdecor_rsztype_t,
85 gfx_coord2_t *);
86 void (*set_cursor)(ui_wdecor_t *, void *, ui_stock_cursor_t);
87} ui_wdecor_cb_t;
88
89#endif
90
91/** @}
92 */
Note: See TracBrowser for help on using the repository browser.