[mutter/configurable-shadows: 3/13] Make MetaShadowFactory public



commit b823ef0007099706e725570525416dd06e2094ee
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Thu Nov 11 10:21:36 2010 -0500

    Make MetaShadowFactory public
    
    The basic MetaShadowFactory type is moved to a public header, while
    the functions to fetch and paint shadows are kept private.
    The public object will be used for configuration of shadows by
    plugins.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=592382

 src/Makefile.am                                    |    4 +-
 ...dow-factory.h => meta-shadow-factory-private.h} |   29 ++---------
 src/compositor/meta-shadow-factory.c               |    7 ++-
 src/compositor/meta-window-actor.c                 |    2 +-
 src/include/meta-shadow-factory.h                  |   52 ++++++++++++++++++++
 5 files changed, 67 insertions(+), 27 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 154f6ad..d010ace 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -29,7 +29,7 @@ mutter_SOURCES= 				\
 	compositor/meta-plugin-manager.c	\
 	compositor/meta-plugin-manager.h	\
 	compositor/meta-shadow-factory.c	\
-	compositor/meta-shadow-factory.h	\
+	compositor/meta-shadow-factory-private.h	\
 	compositor/meta-shaped-texture.c	\
 	compositor/meta-shaped-texture.h	\
 	compositor/meta-texture-tower.c		\
@@ -44,6 +44,7 @@ mutter_SOURCES= 				\
 	compositor/region-utils.h		\
 	include/compositor.h			\
 	include/meta-plugin.h			\
+	include/meta-shadow-factory.h		\
 	include/meta-window-actor.h		\
 	include/compositor-mutter.h 		\
 	core/constraints.c			\
@@ -169,6 +170,7 @@ libmutterinclude_base_headers =		\
 	include/group.h				\
 	include/keybindings.h			\
 	include/meta-plugin.h			\
+	include/meta-shadow-factory.h		\
 	include/meta-window-actor.h
 
 # Excluded from scanning for introspection but installed
diff --git a/src/compositor/meta-shadow-factory.h b/src/compositor/meta-shadow-factory-private.h
similarity index 68%
rename from src/compositor/meta-shadow-factory.h
rename to src/compositor/meta-shadow-factory-private.h
index 8dc9e95..2a05212 100644
--- a/src/compositor/meta-shadow-factory.h
+++ b/src/compositor/meta-shadow-factory-private.h
@@ -22,18 +22,13 @@
  * 02111-1307, USA.
  */
 
-#ifndef __META_SHADOW_FACTORY_H__
-#define __META_SHADOW_FACTORY_H__
+#ifndef __META_SHADOW_FACTORY_PRIVATE_H__
+#define __META_SHADOW_FACTORY_PRIVATE_H__
 
+#include <cairo.h>
 #include <clutter/clutter.h>
 #include "meta-window-shape.h"
-
-#define META_TYPE_SHADOW_FACTORY            (meta_shadow_factory_get_type ())
-#define META_SHADOW_FACTORY(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_SHADOW_FACTORY, MetaShadowFactory))
-#define META_SHADOW_FACTORY_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  META_TYPE_SHADOW_FACTORY, MetaShadowFactoryClass))
-#define META_IS_SHADOW_FACTORY(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_SHADOW_FACTORY))
-#define META_IS_SHADOW_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  META_TYPE_SHADOW_FACTORY))
-#define META_SHADOW_FACTORY_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  META_TYPE_SHADOW_FACTORY, MetaShadowFactoryClass))
+#include "meta-shadow-factory.h"
 
 /**
  * MetaShadow:
@@ -59,20 +54,6 @@ void        meta_shadow_get_bounds  (MetaShadow            *shadow,
                                      int                    window_height,
                                      cairo_rectangle_int_t *bounds);
 
-/**
- * MetaShadowFactory:
- * #MetaShadowFactory is used to create window shadows. It caches shadows internally
- * so that multiple shadows created for the same shape with the same radius will
- * share the same MetaShadow.
- */
-typedef struct _MetaShadowFactory      MetaShadowFactory;
-typedef struct _MetaShadowFactoryClass MetaShadowFactoryClass;
-
-MetaShadowFactory *meta_shadow_factory_get_default (void);
-
-GType meta_shadow_factory_get_type (void);
-
-MetaShadowFactory *meta_shadow_factory_new        (void);
 MetaShadow *       meta_shadow_factory_get_shadow (MetaShadowFactory *factory,
                                                    MetaWindowShape   *shape,
                                                    int                width,
@@ -80,4 +61,4 @@ MetaShadow *       meta_shadow_factory_get_shadow (MetaShadowFactory *factory,
                                                    int                radius,
                                                    int                top_fade);
 
-#endif /* __META_SHADOW_FACTORY_H__ */
+#endif /* __META_SHADOW_FACTORY_PRIVATE_H__ */
diff --git a/src/compositor/meta-shadow-factory.c b/src/compositor/meta-shadow-factory.c
index 577e33b..935c8bc 100644
--- a/src/compositor/meta-shadow-factory.c
+++ b/src/compositor/meta-shadow-factory.c
@@ -25,7 +25,7 @@
 #include <math.h>
 #include <string.h>
 
-#include "meta-shadow-factory.h"
+#include "meta-shadow-factory-private.h"
 #include "region-utils.h"
 
 /* This file implements blurring the shape of a window to produce a
@@ -304,6 +304,11 @@ meta_shadow_factory_new (void)
   return g_object_new (META_TYPE_SHADOW_FACTORY, NULL);
 }
 
+/**
+ * meta_shadow_factory_get_default:
+ *
+ * Return value: (transfer none): the global singleton shadow factory
+ */
 MetaShadowFactory *
 meta_shadow_factory_get_default (void)
 {
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index ddedd51..6f0496f 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -17,7 +17,7 @@
 #include "xprops.h"
 
 #include "compositor-private.h"
-#include "meta-shadow-factory.h"
+#include "meta-shadow-factory-private.h"
 #include "meta-shaped-texture.h"
 #include "meta-window-actor-private.h"
 
diff --git a/src/include/meta-shadow-factory.h b/src/include/meta-shadow-factory.h
new file mode 100644
index 0000000..e27fc98
--- /dev/null
+++ b/src/include/meta-shadow-factory.h
@@ -0,0 +1,52 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * MetaShadowFactory:
+ *
+ * Create and cache shadow textures for arbitrary window shapes
+ *
+ * Copyright (C) 2010 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef __META_SHADOW_FACTORY_H__
+#define __META_SHADOW_FACTORY_H__
+
+#include <glib-object.h>
+
+#define META_TYPE_SHADOW_FACTORY            (meta_shadow_factory_get_type ())
+#define META_SHADOW_FACTORY(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_SHADOW_FACTORY, MetaShadowFactory))
+#define META_SHADOW_FACTORY_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  META_TYPE_SHADOW_FACTORY, MetaShadowFactoryClass))
+#define META_IS_SHADOW_FACTORY(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_SHADOW_FACTORY))
+#define META_IS_SHADOW_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  META_TYPE_SHADOW_FACTORY))
+#define META_SHADOW_FACTORY_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  META_TYPE_SHADOW_FACTORY, MetaShadowFactoryClass))
+
+/**
+ * MetaShadowFactory:
+ * #MetaShadowFactory is used to create window shadows. It caches shadows internally
+ * so that multiple shadows created for the same shape with the same radius will
+ * share the same MetaShadow.
+ */
+typedef struct _MetaShadowFactory      MetaShadowFactory;
+typedef struct _MetaShadowFactoryClass MetaShadowFactoryClass;
+
+MetaShadowFactory *meta_shadow_factory_get_default (void);
+
+GType meta_shadow_factory_get_type (void);
+
+MetaShadowFactory *meta_shadow_factory_new        (void);
+
+#endif /* __META_SHADOW_FACTORY_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]