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/)
35 * \author Bernie Innocenti <bernie@codewiz.org>
37 * \brief Very simple hierarchical windowing system.
39 * All functions in this module are to be intended as methods
40 * of the Window class. Please see its documentation
41 * for a module-wise introduction.
48 *#* Revision 1.3 2006/07/19 12:56:27 bernie
49 *#* Convert to new Doxygen style.
51 *#* Revision 1.2 2006/01/26 00:36:48 bernie
52 *#* Const correctness for some new functions.
54 *#* Revision 1.1 2006/01/23 23:14:29 bernie
55 *#* Implement simple, but impressive windowing system.
62 #include <struct/list.h> /* Node, List */
63 #include <gfx/gfx.h> /* coord_t */
69 * Window handle and context structure.
71 * A window is a small rectangular area on the
72 * screen backed by its own bitmap where you
75 * A window can contain any number of children
76 * sub-windows that can be depth arranged with
77 * respect to their siblings.
79 * At any time, a window and all its children
80 * can be drawn into another bitmap to display
81 * a complete screen, taking depth and
82 * overlapping into account.
84 * This rendering model is commonly referred to as
85 * screen composition, and is quite popular among
86 * modern windowing systems.
90 Node link; /**< Link us with other siblings into our parent. */
91 struct Window *parent; /**< Our parent window. NULL for the root window. */
93 Bitmap *bitmap; /**< Pixel storage for window contents. */
94 Rect geom; /**< [px] Window size and position relative to parent. */
97 * List of child windows, arranged by depth (front to back).
99 * Child top/left coordinates are relative to us.
106 * Public function prototypes
108 void win_compose(Window *w);
109 void win_open(Window *w, Window *parent);
110 void win_close(Window *w);
111 void win_raise(Window *w);
112 void win_setGeometry(Window *w, const Rect *new_geom);
113 void win_move(Window *w, coord_t left, coord_t top);
114 void win_resize(Window *w, coord_t width, coord_t height);
115 void win_create(Window *w, Bitmap *bm);
119 #endif /* GFX_WIN_H */