From 5d8b177679038811a1d2ae88943e2f44e0f51918 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 29 Mar 2012 17:27:34 +0100 Subject: [PATCH] bin-layout: Deprecate BinLayout alignments We should use the ClutterActor's API for this. --- clutter/Makefile.am | 1 + clutter/clutter-bin-layout.c | 16 +++++++++- clutter/clutter-bin-layout.h | 14 --------- clutter/clutter-deprecated.h | 1 + clutter/clutter-enums.h | 3 ++ clutter/deprecated/clutter-bin-layout.h | 56 +++++++++++++++++++++++++++++++++ 6 files changed, 76 insertions(+), 15 deletions(-) create mode 100644 clutter/deprecated/clutter-bin-layout.h diff --git a/clutter/Makefile.am b/clutter/Makefile.am index 75dad37..d59afd1 100644 --- a/clutter/Makefile.am +++ b/clutter/Makefile.am @@ -257,6 +257,7 @@ deprecated_h = \ $(srcdir)/deprecated/clutter-behaviour-path.h \ $(srcdir)/deprecated/clutter-behaviour-rotate.h \ $(srcdir)/deprecated/clutter-behaviour-scale.h \ + $(srcdir)/deprecated/clutter-bin-layout.h \ $(srcdir)/deprecated/clutter-box.h \ $(srcdir)/deprecated/clutter-cairo-texture.h \ $(srcdir)/deprecated/clutter-container.h \ diff --git a/clutter/clutter-bin-layout.c b/clutter/clutter-bin-layout.c index 11dd0a6..45cab47 100644 --- a/clutter/clutter-bin-layout.c +++ b/clutter/clutter-bin-layout.c @@ -69,10 +69,10 @@ #define CLUTTER_DISABLE_DEPRECATION_WARNINGS #include "deprecated/clutter-container.h" +#include "deprecated/clutter-bin-layout.h" #include "clutter-actor-private.h" #include "clutter-animatable.h" -#include "clutter-bin-layout.h" #include "clutter-child-meta.h" #include "clutter-debug.h" #include "clutter-enum-types.h" @@ -600,6 +600,9 @@ clutter_bin_layout_class_init (ClutterBinLayoutClass *klass) * by the #ClutterBinLayout * * Since: 1.2 + * + * Deprecated: 1.12: Use the #ClutterActor:x-expand and the + * #ClutterActor:x-align properties on #ClutterActor instead. */ bin_props[PROP_X_ALIGN] = g_param_spec_enum ("x-align", @@ -617,6 +620,9 @@ clutter_bin_layout_class_init (ClutterBinLayoutClass *klass) * by the #ClutterBinLayout * * Since: 1.2 + * + * Deprecated: 1.12: Use the #ClutterActor:y-expand and the + * #ClutterActor:y-align properties on #ClutterActor instead. */ bin_props[PROP_Y_ALIGN] = g_param_spec_enum ("y-align", @@ -687,6 +693,9 @@ clutter_bin_layout_new (ClutterBinAlignment x_align, * be set as the default alignment policies * * Since: 1.2 + * + * Deprecated: 1.12: Use the #ClutterActor:x-align and + * #ClutterActor:y-align properties of #ClutterActor instead. */ void clutter_bin_layout_set_alignment (ClutterBinLayout *self, @@ -745,6 +754,9 @@ clutter_bin_layout_set_alignment (ClutterBinLayout *self, * instead * * Since: 1.2 + * + * Deprecated: 1.12: Use the #ClutterActor:x-align and the + * #ClutterActor:y-align properties of #ClutterActor instead. */ void clutter_bin_layout_get_alignment (ClutterBinLayout *self, @@ -811,6 +823,8 @@ clutter_bin_layout_get_alignment (ClutterBinLayout *self, * #ClutterBinLayout * * Since: 1.2 + * + * Deprecated: 1.12: Use clutter_actor_add_child() instead. */ void clutter_bin_layout_add (ClutterBinLayout *self, diff --git a/clutter/clutter-bin-layout.h b/clutter/clutter-bin-layout.h index d6a639f..6f52ba1 100644 --- a/clutter/clutter-bin-layout.h +++ b/clutter/clutter-bin-layout.h @@ -79,20 +79,6 @@ GType clutter_bin_layout_get_type (void) G_GNUC_CONST; ClutterLayoutManager *clutter_bin_layout_new (ClutterBinAlignment x_align, ClutterBinAlignment y_align); -void clutter_bin_layout_set_alignment (ClutterBinLayout *self, - ClutterActor *child, - ClutterBinAlignment x_align, - ClutterBinAlignment y_align); -void clutter_bin_layout_get_alignment (ClutterBinLayout *self, - ClutterActor *child, - ClutterBinAlignment *x_align, - ClutterBinAlignment *y_align); - -void clutter_bin_layout_add (ClutterBinLayout *self, - ClutterActor *child, - ClutterBinAlignment x_align, - ClutterBinAlignment y_align); - G_END_DECLS #endif /* __CLUTTER_BIN_LAYOUT_H__ */ diff --git a/clutter/clutter-deprecated.h b/clutter/clutter-deprecated.h index d80a4b4..868b053 100644 --- a/clutter/clutter-deprecated.h +++ b/clutter/clutter-deprecated.h @@ -15,6 +15,7 @@ #include "deprecated/clutter-behaviour-path.h" #include "deprecated/clutter-behaviour-rotate.h" #include "deprecated/clutter-behaviour-scale.h" +#include "deprecated/clutter-bin-layout.h" #include "deprecated/clutter-box.h" #include "deprecated/clutter-cairo-texture.h" #include "deprecated/clutter-container.h" diff --git a/clutter/clutter-enums.h b/clutter/clutter-enums.h index 845e700..1712201 100644 --- a/clutter/clutter-enums.h +++ b/clutter/clutter-enums.h @@ -467,6 +467,9 @@ typedef enum { * The alignment policies available on each axis for #ClutterBinLayout * * Since: 1.2 + * + * Deprecated: 1.12: Use #ClutterActorAlign and the #ClutterActor + * API instead */ typedef enum { CLUTTER_BIN_ALIGNMENT_FIXED, diff --git a/clutter/deprecated/clutter-bin-layout.h b/clutter/deprecated/clutter-bin-layout.h new file mode 100644 index 0000000..2d56d1f --- /dev/null +++ b/clutter/deprecated/clutter-bin-layout.h @@ -0,0 +1,56 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright (C) 2009 Intel Corporation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + * + * Author: + * Emmanuele Bassi + */ + +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_BIN_LAYOUT_DEPRECATED_H__ +#define __CLUTTER_BIN_LAYOUT_DEPRECATED_H__ + +#include + +G_BEGIN_DECLS + +CLUTTER_DEPRECATED_IN_1_12 +void clutter_bin_layout_set_alignment (ClutterBinLayout *self, + ClutterActor *child, + ClutterBinAlignment x_align, + ClutterBinAlignment y_align); + +CLUTTER_DEPRECATED_IN_1_12 +void clutter_bin_layout_get_alignment (ClutterBinLayout *self, + ClutterActor *child, + ClutterBinAlignment *x_align, + ClutterBinAlignment *y_align); + +CLUTTER_DEPRECATED_IN_1_12 +void clutter_bin_layout_add (ClutterBinLayout *self, + ClutterActor *child, + ClutterBinAlignment x_align, + ClutterBinAlignment y_align); + +G_END_DECLS + +#endif /* __CLUTTER_BIN_LAYOUT_DEPRECATED_H__ */ -- 2.7.4