4 * This file is part of BeRTOS.
6 * Bertos is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 * As a special exception, you may use this file as part of a free software
21 * library without restriction. Specifically, if other files instantiate
22 * templates or use macros or inline functions from this file, or you compile
23 * this file and link it with other files to produce an executable, this
24 * file does not by itself cause the resulting executable to be covered by
25 * the GNU General Public License. This exception does not however
26 * invalidate any other reasons why the executable file might be covered by
27 * the GNU General Public License.
29 * Copyright 2006 Develer S.r.l. (http://www.develer.com/)
34 * \author Bernie Innocenti <bernie@codewiz.org>
36 * \brief Very simple hierarchical windowing system.
38 * All functions in this module are to be intended as methods
39 * of the Window class. Please see its documentation
40 * for a module-wise introduction.
47 *#* Revision 1.3 2006/07/19 12:56:27 bernie
48 *#* Convert to new Doxygen style.
50 *#* Revision 1.2 2006/01/26 00:36:48 bernie
51 *#* Const correctness for some new functions.
53 *#* Revision 1.1 2006/01/23 23:14:29 bernie
54 *#* Implement simple, but impressive windowing system.
61 #include <struct/list.h> /* Node, List */
62 #include <gfx/gfx.h> /* coord_t */
68 * Window handle and context structure.
70 * A window is a small rectangular area on the
71 * screen backed by its own bitmap where you
74 * A window can contain any number of children
75 * sub-windows that can be depth arranged with
76 * respect to their siblings.
78 * At any time, a window and all its children
79 * can be drawn into another bitmap to display
80 * a complete screen, taking depth and
81 * overlapping into account.
83 * This rendering model is commonly referred to as
84 * screen composition, and is quite popular among
85 * modern windowing systems.
89 Node link; /**< Link us with other siblings into our parent. */
90 struct Window *parent; /**< Our parent window. NULL for the root window. */
92 Bitmap *bitmap; /**< Pixel storage for window contents. */
93 Rect geom; /**< [px] Window size and position relative to parent. */
96 * List of child windows, arranged by depth (front to back).
98 * Child top/left coordinates are relative to us.
105 * Public function prototypes
107 void win_compose(Window *w);
108 void win_open(Window *w, Window *parent);
109 void win_close(Window *w);
110 void win_raise(Window *w);
111 void win_setGeometry(Window *w, const Rect *new_geom);
112 void win_move(Window *w, coord_t left, coord_t top);
113 void win_resize(Window *w, coord_t width, coord_t height);
114 void win_create(Window *w, Bitmap *bm);
118 #endif /* GFX_WIN_H */