1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /*
3  * MetaShadowFactory:
4  *
5  * Create and cache shadow textures for arbitrary window shapes
6  *
7  * Copyright (C) 2010 Red Hat, Inc.
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License as
11  * published by the Free Software Foundation; either version 2 of the
12  * License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street - Suite 500, Boston, MA
22  * 02110-1335, USA.
23  */
24 
25 #ifndef __META_SHADOW_FACTORY_PRIVATE_H__
26 #define __META_SHADOW_FACTORY_PRIVATE_H__
27 
28 #include <cairo.h>
29 #include <clutter/clutter.h>
30 #include "meta-window-shape.h"
31 #include <meta/meta-shadow-factory.h>
32 
33 /**
34  * MetaShadow:
35  * #MetaShadow holds a shadow texture along with information about how to
36  * apply that texture to draw a window texture. (E.g., it knows how big the
37  * unscaled borders are on each side of the shadow texture.)
38  */
39 typedef struct _MetaShadow MetaShadow;
40 
41 MetaShadow *meta_shadow_ref         (MetaShadow            *shadow);
42 void        meta_shadow_unref       (MetaShadow            *shadow);
43 CoglTexture*meta_shadow_get_texture (MetaShadow            *shadow);
44 void        meta_shadow_paint       (MetaShadow            *shadow,
45                                      CoglFramebuffer       *framebuffer,
46                                      int                    window_x,
47                                      int                    window_y,
48                                      int                    window_width,
49                                      int                    window_height,
50                                      guint8                 opacity,
51                                      cairo_region_t        *clip,
52                                      gboolean               clip_strictly);
53 void        meta_shadow_get_bounds  (MetaShadow            *shadow,
54                                      int                    window_x,
55                                      int                    window_y,
56                                      int                    window_width,
57                                      int                    window_height,
58                                      cairo_rectangle_int_t *bounds);
59 
60 MetaShadowFactory *meta_shadow_factory_new (void);
61 
62 MetaShadow *meta_shadow_factory_get_shadow (MetaShadowFactory *factory,
63                                             MetaWindowShape   *shape,
64                                             int                width,
65                                             int                height,
66                                             const char        *class_name,
67                                             gboolean           focused);
68 
69 #endif /* __META_SHADOW_FACTORY_PRIVATE_H__ */
70