1 /*
2    (c) Copyright 2001-2009  The world wide DirectFB Open Source Community (directfb.org)
3    (c) Copyright 2000-2004  Convergence (integrated media) GmbH
4 
5    All rights reserved.
6 
7    Written by Denis Oliver Kropp <dok@directfb.org>,
8               Andreas Hundt <andi@fischlustig.de>,
9               Sven Neumann <neo@directfb.org>,
10               Ville Syrjälä <syrjala@sci.fi> and
11               Claudio Ciccani <klan@users.sf.net>.
12 
13    This library is free software; you can redistribute it and/or
14    modify it under the terms of the GNU Lesser General Public
15    License as published by the Free Software Foundation; either
16    version 2 of the License, or (at your option) any later version.
17 
18    This library is distributed in the hope that it will be useful,
19    but WITHOUT ANY WARRANTY; without even the implied warranty of
20    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21    Lesser General Public License for more details.
22 
23    You should have received a copy of the GNU Lesser General Public
24    License along with this library; if not, write to the
25    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26    Boston, MA 02111-1307, USA.
27 */
28 
29 #ifndef __CORE__WINDOWSTACK_H__
30 #define __CORE__WINDOWSTACK_H__
31 
32 #include <core/coredefs.h>
33 #include <core/coretypes.h>
34 
35 #include <fusion/lock.h>
36 
37 /*
38  * allocates a WindowStack, initializes it, registers it for input events
39  */
40 CoreWindowStack *dfb_windowstack_create ( CoreLayerContext *context );
41 
42 void             dfb_windowstack_detach_devices( CoreWindowStack  *stack );
43 
44 void             dfb_windowstack_destroy( CoreWindowStack  *stack );
45 
46 void             dfb_windowstack_resize ( CoreWindowStack  *stack,
47                                           int               width,
48                                           int               height,
49                                           int               rotation );
50 
51 DirectResult     dfb_windowstack_lock   ( CoreWindowStack  *stack );
52 
53 DirectResult     dfb_windowstack_unlock ( CoreWindowStack  *stack );
54 
55 
56 
57 
58 
59 /*
60  * repaints all window on a window stack
61  */
62 DFBResult dfb_windowstack_repaint_all( CoreWindowStack *stack );
63 
64 /*
65  * background handling
66  */
67 DFBResult dfb_windowstack_set_background_mode ( CoreWindowStack               *stack,
68                                                 DFBDisplayLayerBackgroundMode  mode );
69 
70 DFBResult dfb_windowstack_set_background_image( CoreWindowStack               *stack,
71                                                 CoreSurface                   *image );
72 
73 DFBResult dfb_windowstack_set_background_color( CoreWindowStack               *stack,
74                                                 const DFBColor                *color );
75 
76 DFBResult dfb_windowstack_set_background_color_index( CoreWindowStack         *stack,
77                                                       int                      index );
78 
79 
80 /*
81  * cursor control
82  */
83 DFBResult dfb_windowstack_cursor_enable( CoreDFB         *core,
84                                          CoreWindowStack *stack,
85                                          bool             enable );
86 
87 DFBResult dfb_windowstack_cursor_set_shape( CoreWindowStack *stack,
88                                             CoreSurface     *shape,
89                                             int              hot_x,
90                                             int              hot_y );
91 
92 DFBResult dfb_windowstack_cursor_set_opacity( CoreWindowStack *stack,
93                                               u8               opacity );
94 
95 DFBResult dfb_windowstack_cursor_set_acceleration( CoreWindowStack *stack,
96                                                    int              numerator,
97                                                    int              denominator,
98                                                    int              threshold );
99 
100 DFBResult dfb_windowstack_cursor_warp( CoreWindowStack *stack,
101                                        int              x,
102                                        int              y );
103 
104 
105 DFBResult dfb_windowstack_get_cursor_position (CoreWindowStack *stack,
106                                                int             *x,
107                                                int             *y);
108 
109 
110 #endif
111