1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 
3 /*
4  * Copyright (C) 2013 Red Hat
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, see <http://www.gnu.org/licenses/>.
18  *
19  * Written by:
20  *     Owen Taylor <otaylor@redhat.com>
21  *     Ray Strode <rstrode@redhat.com>
22  *     Jasper St. Pierre <jstpierre@mecheye.net>
23  */
24 
25 #ifndef __META_CULLABLE_H__
26 #define __META_CULLABLE_H__
27 
28 #include "clutter/clutter.h"
29 
30 G_BEGIN_DECLS
31 
32 #define META_TYPE_CULLABLE (meta_cullable_get_type ())
33 G_DECLARE_INTERFACE (MetaCullable, meta_cullable, META, CULLABLE, ClutterActor)
34 
35 struct _MetaCullableInterface
36 {
37   GTypeInterface g_iface;
38 
39   void (* cull_out)      (MetaCullable   *cullable,
40                           cairo_region_t *unobscured_region,
41                           cairo_region_t *clip_region);
42   gboolean (* is_untransformed) (MetaCullable *cullable);
43   void (* reset_culling) (MetaCullable  *cullable);
44 };
45 
46 void meta_cullable_cull_out (MetaCullable   *cullable,
47                              cairo_region_t *unobscured_region,
48                              cairo_region_t *clip_region);
49 gboolean meta_cullable_is_untransformed (MetaCullable *cullable);
50 void meta_cullable_reset_culling (MetaCullable *cullable);
51 
52 /* Utility methods for implementations */
53 void meta_cullable_cull_out_children (MetaCullable   *cullable,
54                                       cairo_region_t *unobscured_region,
55                                       cairo_region_t *clip_region);
56 void meta_cullable_reset_culling_children (MetaCullable *cullable);
57 
58 G_END_DECLS
59 
60 #endif /* __META_CULLABLE_H__ */
61 
62