~ubuntu-branches/ubuntu/vivid/clutter-1.0/vivid-proposed

« back to all changes in this revision

Viewing changes to clutter/clutter-box-layout.c

  • Committer: Package Import Robot
  • Author(s): Michael Biebl
  • Date: 2012-05-01 23:50:39 UTC
  • mfrom: (4.1.22 experimental)
  • Revision ID: package-import@ubuntu.com-20120501235039-7wehcmtr33nqhv67
Tags: 1.10.4-2
Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
 
76
76
#include <math.h>
77
77
 
 
78
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
 
79
#include "deprecated/clutter-container.h"
 
80
 
78
81
#include "clutter-box-layout.h"
 
82
 
 
83
#include "clutter-actor-private.h"
79
84
#include "clutter-debug.h"
80
85
#include "clutter-enum-types.h"
81
86
#include "clutter-layout-meta.h"
130
135
  PROP_CHILD_Y_ALIGN,
131
136
  PROP_CHILD_X_FILL,
132
137
  PROP_CHILD_Y_FILL,
133
 
  PROP_CHILD_EXPAND
 
138
  PROP_CHILD_EXPAND,
 
139
 
 
140
  PROP_CHILD_LAST
134
141
};
135
142
 
136
143
enum
143
150
  PROP_PACK_START,
144
151
  PROP_USE_ANIMATIONS,
145
152
  PROP_EASING_MODE,
146
 
  PROP_EASING_DURATION
 
153
  PROP_EASING_DURATION,
 
154
 
 
155
  PROP_LAST
147
156
};
148
157
 
 
158
static GParamSpec *obj_props[PROP_LAST] = { NULL, };
 
159
 
 
160
GType clutter_box_child_get_type (void);
 
161
 
149
162
G_DEFINE_TYPE (ClutterBoxChild,
150
163
               clutter_box_child,
151
164
               CLUTTER_TYPE_LAYOUT_META);
463
476
      /* we need to change the :request-mode of the container
464
477
       * to match the orientation
465
478
       */
466
 
      request_mode = (priv->is_vertical
467
 
                      ? CLUTTER_REQUEST_HEIGHT_FOR_WIDTH
468
 
                      : CLUTTER_REQUEST_WIDTH_FOR_HEIGHT);
 
479
      request_mode = priv->is_vertical
 
480
                   ? CLUTTER_REQUEST_HEIGHT_FOR_WIDTH
 
481
                   : CLUTTER_REQUEST_WIDTH_FOR_HEIGHT;
469
482
      clutter_actor_set_request_mode (CLUTTER_ACTOR (priv->container),
470
483
                                      request_mode);
471
484
    }
476
489
 
477
490
static void
478
491
get_preferred_width (ClutterBoxLayout *self,
479
 
                     ClutterContainer *container,
480
 
                     GList            *children,
 
492
                     ClutterActor     *container,
481
493
                     gfloat            for_height,
482
494
                     gfloat           *min_width_p,
483
495
                     gfloat           *natural_width_p)
484
496
{
485
497
  ClutterBoxLayoutPrivate *priv = self->priv;
 
498
  ClutterActor *child;
486
499
  gint n_children = 0;
487
500
  gboolean is_rtl;
488
 
  GList *l;
489
501
 
490
502
  if (min_width_p)
491
503
    *min_width_p = 0;
497
509
    {
498
510
      ClutterTextDirection text_dir;
499
511
 
500
 
      text_dir = clutter_actor_get_text_direction (CLUTTER_ACTOR (container));
 
512
      text_dir = clutter_actor_get_text_direction (container);
501
513
      is_rtl = (text_dir == CLUTTER_TEXT_DIRECTION_RTL) ? TRUE : FALSE;
502
514
    }
503
515
  else
504
516
    is_rtl = FALSE;
505
517
 
506
 
  for (l = (is_rtl) ? g_list_last (children) : children;
507
 
       l != NULL;
508
 
       l = (is_rtl) ? l->prev : l->next)
 
518
  for (child = (is_rtl) ? clutter_actor_get_last_child (container)
 
519
                        : clutter_actor_get_first_child (container);
 
520
       child != NULL;
 
521
       child = (is_rtl) ? clutter_actor_get_previous_sibling (child)
 
522
                        : clutter_actor_get_next_sibling (child))
509
523
    {
510
 
      ClutterActor *child = l->data;
511
524
      gfloat child_min = 0, child_nat = 0;
512
525
 
513
526
      if (!CLUTTER_ACTOR_IS_VISIBLE (child))
553
566
 
554
567
static void
555
568
get_preferred_height (ClutterBoxLayout *self,
556
 
                      ClutterContainer *container,
557
 
                      GList            *children,
 
569
                      ClutterActor     *container,
558
570
                      gfloat            for_width,
559
571
                      gfloat           *min_height_p,
560
572
                      gfloat           *natural_height_p)
561
573
{
562
574
  ClutterBoxLayoutPrivate *priv = self->priv;
 
575
  ClutterActor *child;
563
576
  gint n_children = 0;
564
577
  gboolean is_rtl;
565
 
  GList *l;
566
578
 
567
579
  if (min_height_p)
568
580
    *min_height_p = 0;
574
586
    {
575
587
      ClutterTextDirection text_dir;
576
588
 
577
 
      text_dir = clutter_actor_get_text_direction (CLUTTER_ACTOR (container));
 
589
      text_dir = clutter_actor_get_text_direction (container);
578
590
      is_rtl = (text_dir == CLUTTER_TEXT_DIRECTION_RTL) ? TRUE : FALSE;
579
591
    }
580
592
  else
581
593
    is_rtl = FALSE;
582
594
 
583
 
  for (l = (is_rtl) ? g_list_last (children) : children;
584
 
       l != NULL;
585
 
       l = (is_rtl) ? l->prev : l->next)
 
595
  for (child = (is_rtl) ? clutter_actor_get_last_child (container)
 
596
                        : clutter_actor_get_first_child (container);
 
597
       child != NULL;
 
598
       child = (is_rtl) ? clutter_actor_get_previous_sibling (child)
 
599
                        : clutter_actor_get_next_sibling (child))
586
600
    {
587
 
      ClutterActor *child = l->data;
588
601
      gfloat child_min = 0, child_nat = 0;
589
602
 
590
603
      if (!CLUTTER_ACTOR_IS_VISIBLE (child))
644
657
                                                child);
645
658
  box_child = CLUTTER_BOX_CHILD (meta);
646
659
 
 
660
  CLUTTER_NOTE (LAYOUT, "Allocation for %s { %.2f, %.2f, %.2f, %.2f }",
 
661
                _clutter_actor_get_debug_name (child),
 
662
                child_box->x1, child_box->y1,
 
663
                child_box->x2 - child_box->x1,
 
664
                child_box->y2 - child_box->y1);
 
665
 
647
666
  clutter_actor_allocate_align_fill (child, child_box,
648
667
                                     get_box_alignment_factor (box_child->x_align),
649
668
                                     get_box_alignment_factor (box_child->y_align),
673
692
          box_child->last_allocation = final_child_box;
674
693
          box_child->has_last_allocation = TRUE;
675
694
 
676
 
          goto do_allocate;
 
695
          return;
677
696
        }
678
697
 
679
698
      start = &box_child->last_allocation;
693
712
                    final_child_box.x2, final_child_box.y2,
694
713
                    end.x1, end.y1,
695
714
                    end.x2, end.y2);
 
715
 
 
716
      clutter_actor_allocate (child, &final_child_box, flags);
696
717
    }
697
718
  else
698
719
    {
699
720
      /* store the allocation for later animations */
700
721
      box_child->last_allocation = final_child_box;
701
722
      box_child->has_last_allocation = TRUE;
 
723
 
 
724
      return;
702
725
    }
703
 
 
704
 
do_allocate:
705
 
  clutter_actor_allocate (child, &final_child_box, flags);
706
726
}
707
727
 
708
728
static void
713
733
                                        gfloat               *natural_width_p)
714
734
{
715
735
  ClutterBoxLayout *self = CLUTTER_BOX_LAYOUT (layout);
716
 
  GList *children;
717
 
 
718
 
  children = clutter_container_get_children (container);
719
 
 
720
 
  get_preferred_width (self, container, children, for_height,
 
736
 
 
737
  get_preferred_width (self, CLUTTER_ACTOR (container), for_height,
721
738
                       min_width_p,
722
739
                       natural_width_p);
723
 
 
724
 
  g_list_free (children);
725
740
}
726
741
 
727
742
static void
732
747
                                         gfloat               *natural_height_p)
733
748
{
734
749
  ClutterBoxLayout *self = CLUTTER_BOX_LAYOUT (layout);
735
 
  GList *children;
736
 
 
737
 
  children = clutter_container_get_children (container);
738
 
 
739
 
  get_preferred_height (self, container, children, for_width,
 
750
 
 
751
  get_preferred_height (self, CLUTTER_ACTOR (container), for_width,
740
752
                        min_height_p,
741
753
                        natural_height_p);
742
 
 
743
 
  g_list_free (children);
744
754
}
745
755
 
746
756
static void
749
759
                       gint                 *visible_children,
750
760
                       gint                 *expand_children)
751
761
{
752
 
  GList        *children, *l;
753
 
  ClutterActor *child;
 
762
  ClutterActor *actor, *child;
 
763
  ClutterActorIter iter;
 
764
 
 
765
  actor = CLUTTER_ACTOR (container);
754
766
 
755
767
  *visible_children = *expand_children = 0;
756
768
 
757
 
  children = clutter_container_get_children (container);
758
 
  for (l = children; l != NULL; l = l->next)
 
769
  clutter_actor_iter_init (&iter, actor);
 
770
  while (clutter_actor_iter_next (&iter, &child))
759
771
    {
760
 
      child = l->data;
761
 
 
762
772
      if (CLUTTER_ACTOR_IS_VISIBLE (child))
763
773
        {
764
774
          ClutterLayoutMeta *meta;
773
783
            *expand_children += 1;
774
784
        }
775
785
    }
776
 
  g_list_free (children);
777
786
}
778
787
 
779
 
struct _ClutterRequestedSize
 
788
typedef struct _RequestedSize
780
789
{
781
790
  ClutterActor *actor;
782
791
 
783
792
  gfloat minimum_size;
784
793
  gfloat natural_size;
785
 
};
 
794
} RequestedSize;
786
795
 
787
796
/* Pulled from gtksizerequest.c from Gtk+ */
788
 
 
789
797
static gint
790
798
compare_gap (gconstpointer p1,
791
799
             gconstpointer p2,
792
800
             gpointer      data)
793
801
{
794
 
  struct _ClutterRequestedSize *sizes = data;
 
802
  RequestedSize *sizes = data;
795
803
  const guint *c1 = p1;
796
804
  const guint *c2 = p2;
797
805
 
813
821
/*
814
822
 * distribute_natural_allocation:
815
823
 * @extra_space: Extra space to redistribute among children after subtracting
816
 
 *               minimum sizes and any child padding from the overall allocation
 
824
 *   minimum sizes and any child padding from the overall allocation
817
825
 * @n_requested_sizes: Number of requests to fit into the allocation
818
826
 * @sizes: An array of structs with a client pointer and a minimum/natural size
819
 
 *         in the orientation of the allocation.
 
827
 *   in the orientation of the allocation.
820
828
 *
821
829
 * Distributes @extra_space to child @sizes by bringing smaller
822
830
 * children up to natural size first.
823
831
 *
824
832
 * The remaining space will be added to the @minimum_size member of the
825
 
 * GtkRequestedSize struct. If all sizes reach their natural size then
 
833
 * RequestedSize struct. If all sizes reach their natural size then
826
834
 * the remaining space is returned.
827
835
 *
828
836
 * Returns: The remainder of @extra_space after redistributing space
831
839
 * Pulled from gtksizerequest.c from Gtk+
832
840
 */
833
841
static gint
834
 
distribute_natural_allocation (gint                   extra_space,
835
 
                               guint                  n_requested_sizes,
836
 
                               struct _ClutterRequestedSize *sizes)
 
842
distribute_natural_allocation (gint           extra_space,
 
843
                               guint          n_requested_sizes,
 
844
                               RequestedSize *sizes)
837
845
{
838
846
  guint *spreading;
839
847
  gint   i;
899
907
                             ClutterAllocationFlags  flags)
900
908
{
901
909
  ClutterBoxLayoutPrivate *priv = CLUTTER_BOX_LAYOUT (layout)->priv;
902
 
  ClutterActor *child;
903
 
  GList *children, *l;
 
910
  ClutterActor *actor, *child;
904
911
  gint nvis_children;
905
912
  gint nexpand_children;
906
913
  gboolean is_rtl;
 
914
  ClutterActorIter iter;
907
915
 
908
916
  ClutterActorBox child_allocation;
909
 
  struct _ClutterRequestedSize *sizes;
 
917
  RequestedSize *sizes;
910
918
 
911
919
  gint size;
912
920
  gint extra;
916
924
 
917
925
  count_expand_children (layout, container, &nvis_children, &nexpand_children);
918
926
 
 
927
  CLUTTER_NOTE (LAYOUT, "BoxLayout for %s: visible=%d, expand=%d",
 
928
                _clutter_actor_get_debug_name (CLUTTER_ACTOR (container)),
 
929
                nvis_children,
 
930
                nexpand_children);
 
931
 
919
932
  /* If there is no visible child, simply return. */
920
933
  if (nvis_children <= 0)
921
934
    return;
922
935
 
923
 
  sizes = g_newa (struct _ClutterRequestedSize, nvis_children);
 
936
  sizes = g_newa (RequestedSize, nvis_children);
924
937
 
925
938
  if (priv->is_vertical)
926
939
    size = box->y2 - box->y1 - (nvis_children - 1) * priv->spacing;
927
940
  else
928
941
    size = box->x2 - box->x1 - (nvis_children - 1) * priv->spacing;
929
942
 
 
943
  actor = CLUTTER_ACTOR (container);
 
944
 
930
945
  /* Retrieve desired size for visible children. */
931
 
  children = clutter_container_get_children (container);
932
 
  for (i = 0, l = children; l != NULL; l = l->next)
 
946
  i = 0;
 
947
  clutter_actor_iter_init (&iter, actor);
 
948
  while (clutter_actor_iter_next (&iter, &child))
933
949
    {
934
 
      child = l->data;
935
 
 
936
950
      if (!CLUTTER_ACTOR_IS_VISIBLE (child))
937
951
        continue;
938
952
 
950
964
 
951
965
      /* Assert the api is working properly */
952
966
      if (sizes[i].minimum_size < 0)
953
 
        g_error ("GtkBox child %s minimum %s: %f < 0 for %s %f",
954
 
                 clutter_actor_get_name (child),
 
967
        g_error ("ClutterBoxLayout child %s minimum %s: %f < 0 for %s %f",
 
968
                 _clutter_actor_get_debug_name (child),
955
969
                 priv->is_vertical ? "height" : "width",
956
970
                 sizes[i].minimum_size,
957
971
                 priv->is_vertical ? "width" : "height",
958
972
                 priv->is_vertical ? box->x2 - box->x1 : box->y2 - box->y1);
959
973
 
960
974
      if (sizes[i].natural_size < sizes[i].minimum_size)
961
 
        g_error ("GtkBox child %s natural %s: %f < minimum %f for %s %f",
962
 
                 clutter_actor_get_name (child),
 
975
        g_error ("ClutterBoxLayout child %s natural %s: %f < minimum %f for %s %f",
 
976
                 _clutter_actor_get_debug_name (child),
963
977
                 priv->is_vertical ? "height" : "width",
964
978
                 sizes[i].natural_size,
965
979
                 sizes[i].minimum_size,
970
984
 
971
985
      sizes[i].actor = child;
972
986
 
973
 
      i++;
 
987
      i += 1;
974
988
    }
975
 
  g_list_free (children);
976
989
 
977
990
  if (priv->is_homogeneous)
978
991
    {
1017
1030
  /* Allocate child positions. */
1018
1031
  if (priv->is_vertical)
1019
1032
    {
1020
 
      child_allocation.x1 = 0.0;
 
1033
      child_allocation.x1 = box->x1;
1021
1034
      child_allocation.x2 = MAX (1.0, box->x2 - box->x1);
1022
1035
      if (priv->is_pack_start)
1023
 
        y = 0.0;
1024
 
      else
1025
1036
        y = box->y2 - box->y1;
 
1037
      else
 
1038
        y = box->y1;
1026
1039
    }
1027
1040
  else
1028
1041
    {
1029
 
      child_allocation.y1 = 0.0;
 
1042
      child_allocation.y1 = box->y1;
1030
1043
      child_allocation.y2 = MAX (1.0, box->y2 - box->y1);
1031
1044
      if (priv->is_pack_start)
1032
 
        x = 0.0;
 
1045
        x = box->x2 - box->x1;
1033
1046
      else
1034
 
        x = 0.0 + box->x2 - box->x1;
 
1047
        x = box->x1;
1035
1048
    }
1036
1049
 
1037
 
  children = clutter_container_get_children (container);
1038
 
  for (i = g_list_length (children) - 1, l = g_list_last (children);
1039
 
       l != NULL;
1040
 
       l = l->prev, i--)
 
1050
  i = 0;
 
1051
  clutter_actor_iter_init (&iter, actor);
 
1052
  while (clutter_actor_iter_next (&iter, &child))
1041
1053
    {
1042
1054
      ClutterLayoutMeta *meta;
1043
1055
      ClutterBoxChild *box_child;
1044
1056
 
1045
 
      child = l->data;
 
1057
      /* If widget is not visible, skip it. */
 
1058
      if (!CLUTTER_ACTOR_IS_VISIBLE (child))
 
1059
        continue;
 
1060
 
1046
1061
      meta = clutter_layout_manager_get_child_meta (layout,
1047
1062
                                                    container,
1048
1063
                                                    child);
1049
1064
      box_child = CLUTTER_BOX_CHILD (meta);
1050
1065
 
1051
 
      /* If widget is not visible, skip it. */
1052
 
      if (!CLUTTER_ACTOR_IS_VISIBLE (child))
1053
 
        continue;
1054
 
 
1055
1066
      /* Assign the child's size. */
1056
1067
      if (priv->is_homogeneous)
1057
1068
        {
1095
1106
 
1096
1107
          if (priv->is_pack_start)
1097
1108
            {
1098
 
              y += child_size + priv->spacing;
1099
 
            }
1100
 
          else
1101
 
            {
1102
1109
              y -= child_size + priv->spacing;
1103
1110
 
1104
1111
              child_allocation.y1 -= child_size;
1105
1112
              child_allocation.y2 -= child_size;
1106
1113
            }
 
1114
          else
 
1115
            {
 
1116
              y += child_size + priv->spacing;
 
1117
            }
1107
1118
        }
1108
1119
      else /* !priv->is_vertical */
1109
1120
        {
1110
1121
          if (box_child->x_fill)
1111
1122
            {
1112
1123
              child_allocation.x1 = x;
1113
 
              child_allocation.x2 = child_allocation.x1 + MAX (1, child_size);
 
1124
              child_allocation.x2 = child_allocation.x1 + MAX (1.0, child_size);
1114
1125
            }
1115
1126
          else
1116
1127
            {
1120
1131
 
1121
1132
          if (priv->is_pack_start)
1122
1133
            {
1123
 
              x += child_size + priv->spacing;
1124
 
            }
1125
 
          else
1126
 
            {
1127
1134
              x -= child_size + priv->spacing;
1128
1135
 
1129
1136
              child_allocation.x1 -= child_size;
1130
1137
              child_allocation.x2 -= child_size;
1131
1138
            }
 
1139
          else
 
1140
            {
 
1141
              x += child_size + priv->spacing;
 
1142
            }
1132
1143
 
1133
1144
          if (is_rtl)
1134
1145
            {
1135
1146
              gfloat width = child_allocation.x2 - child_allocation.x1;
1136
1147
 
1137
 
              child_allocation.x1 = box->x2 - box->x1 - child_allocation.x1 - (child_allocation.x2 - child_allocation.x1);
 
1148
              child_allocation.x1 = box->x2 - box->x1
 
1149
                                  - child_allocation.x1
 
1150
                                  - (child_allocation.x2 - child_allocation.x1);
1138
1151
              child_allocation.x2 = child_allocation.x1 + width;
1139
1152
            }
1140
1153
 
1145
1158
                            child,
1146
1159
                            &child_allocation,
1147
1160
                            flags);
 
1161
 
 
1162
        i += 1;
1148
1163
    }
1149
 
  g_list_free (children);
1150
1164
}
1151
1165
 
1152
1166
static ClutterAlpha *
1271
1285
{
1272
1286
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
1273
1287
  ClutterLayoutManagerClass *layout_class;
1274
 
  GParamSpec *pspec;
1275
1288
 
1276
1289
  layout_class = CLUTTER_LAYOUT_MANAGER_CLASS (klass);
1277
1290
 
1278
 
  gobject_class->set_property = clutter_box_layout_set_property;
1279
 
  gobject_class->get_property = clutter_box_layout_get_property;
1280
 
 
1281
 
  layout_class->get_preferred_width =
1282
 
    clutter_box_layout_get_preferred_width;
1283
 
  layout_class->get_preferred_height =
1284
 
    clutter_box_layout_get_preferred_height;
 
1291
  layout_class->get_preferred_width = clutter_box_layout_get_preferred_width;
 
1292
  layout_class->get_preferred_height = clutter_box_layout_get_preferred_height;
1285
1293
  layout_class->allocate = clutter_box_layout_allocate;
1286
1294
  layout_class->set_container = clutter_box_layout_set_container;
1287
 
  layout_class->get_child_meta_type =
1288
 
    clutter_box_layout_get_child_meta_type;
 
1295
  layout_class->get_child_meta_type = clutter_box_layout_get_child_meta_type;
1289
1296
  layout_class->begin_animation = clutter_box_layout_begin_animation;
1290
1297
  layout_class->end_animation = clutter_box_layout_end_animation;
1291
1298
 
1299
1306
   *
1300
1307
   * Since: 1.2
1301
1308
   */
1302
 
  pspec = g_param_spec_boolean ("vertical",
1303
 
                                P_("Vertical"),
1304
 
                                P_("Whether the layout should be vertical, "
1305
 
                                   "rather than horizontal"),
1306
 
                                FALSE,
1307
 
                                CLUTTER_PARAM_READWRITE);
1308
 
  g_object_class_install_property (gobject_class, PROP_VERTICAL, pspec);
 
1309
  obj_props[PROP_VERTICAL] =
 
1310
    g_param_spec_boolean ("vertical",
 
1311
                          P_("Vertical"),
 
1312
                          P_("Whether the layout should be vertical, "
 
1313
                             "rather than horizontal"),
 
1314
                          FALSE,
 
1315
                          CLUTTER_PARAM_READWRITE);
1309
1316
 
1310
1317
  /**
1311
1318
   * ClutterBoxLayout:homogeneous:
1315
1322
   *
1316
1323
   * Since: 1.4
1317
1324
   */
1318
 
  pspec = g_param_spec_boolean ("homogeneous",
1319
 
                                P_("Homogeneous"),
1320
 
                                P_("Whether the layout should be homogeneous, "
1321
 
                                   "i.e. all childs get the same size"),
1322
 
                                FALSE,
1323
 
                                CLUTTER_PARAM_READWRITE);
1324
 
  g_object_class_install_property (gobject_class, PROP_HOMOGENEOUS, pspec);
 
1325
  obj_props[PROP_HOMOGENEOUS] =
 
1326
    g_param_spec_boolean ("homogeneous",
 
1327
                          P_("Homogeneous"),
 
1328
                          P_("Whether the layout should be homogeneous, "
 
1329
                             "i.e. all childs get the same size"),
 
1330
                          FALSE,
 
1331
                          CLUTTER_PARAM_READWRITE);
1325
1332
 
1326
1333
  /**
1327
1334
   * ClutterBoxLayout:pack-start:
1331
1338
   *
1332
1339
   * Since: 1.2
1333
1340
   */
1334
 
  pspec = g_param_spec_boolean ("pack-start",
1335
 
                                P_("Pack Start"),
1336
 
                                P_("Whether to pack items at the start of the box"),
1337
 
                                FALSE,
1338
 
                                CLUTTER_PARAM_READWRITE);
1339
 
  g_object_class_install_property (gobject_class, PROP_PACK_START, pspec);
 
1341
  obj_props[PROP_PACK_START] =
 
1342
    g_param_spec_boolean ("pack-start",
 
1343
                          P_("Pack Start"),
 
1344
                          P_("Whether to pack items at the start of the box"),
 
1345
                          FALSE,
 
1346
                          CLUTTER_PARAM_READWRITE);
1340
1347
 
1341
1348
  /**
1342
1349
   * ClutterBoxLayout:spacing:
1345
1352
   *
1346
1353
   * Since: 1.2
1347
1354
   */
1348
 
  pspec = g_param_spec_uint ("spacing",
1349
 
                             P_("Spacing"),
1350
 
                             P_("Spacing between children"),
1351
 
                             0, G_MAXUINT, 0,
1352
 
                             CLUTTER_PARAM_READWRITE);
1353
 
  g_object_class_install_property (gobject_class, PROP_SPACING, pspec);
 
1355
  obj_props[PROP_SPACING] =
 
1356
    g_param_spec_uint ("spacing",
 
1357
                       P_("Spacing"),
 
1358
                       P_("Spacing between children"),
 
1359
                       0, G_MAXUINT, 0,
 
1360
                       CLUTTER_PARAM_READWRITE);
1354
1361
 
1355
1362
  /**
1356
1363
   * ClutterBoxLayout:use-animations:
1360
1367
   *
1361
1368
   * Since: 1.2
1362
1369
   */
1363
 
  pspec = g_param_spec_boolean ("use-animations",
1364
 
                                P_("Use Animations"),
1365
 
                                P_("Whether layout changes should be animated"),
1366
 
                                FALSE,
1367
 
                                CLUTTER_PARAM_READWRITE);
1368
 
  g_object_class_install_property (gobject_class, PROP_USE_ANIMATIONS, pspec);
 
1370
  obj_props[PROP_USE_ANIMATIONS] =
 
1371
    g_param_spec_boolean ("use-animations",
 
1372
                          P_("Use Animations"),
 
1373
                          P_("Whether layout changes should be animated"),
 
1374
                          FALSE,
 
1375
                          CLUTTER_PARAM_READWRITE);
1369
1376
 
1370
1377
  /**
1371
1378
   * ClutterBoxLayout:easing-mode:
1382
1389
   *
1383
1390
   * Since: 1.2
1384
1391
   */
1385
 
  pspec = g_param_spec_ulong ("easing-mode",
1386
 
                              P_("Easing Mode"),
1387
 
                              P_("The easing mode of the animations"),
1388
 
                              0, G_MAXULONG,
1389
 
                              CLUTTER_EASE_OUT_CUBIC,
1390
 
                              CLUTTER_PARAM_READWRITE);
1391
 
  g_object_class_install_property (gobject_class, PROP_EASING_MODE, pspec);
 
1392
  obj_props[PROP_EASING_MODE] =
 
1393
    g_param_spec_ulong ("easing-mode",
 
1394
                        P_("Easing Mode"),
 
1395
                        P_("The easing mode of the animations"),
 
1396
                        0, G_MAXULONG,
 
1397
                        CLUTTER_EASE_OUT_CUBIC,
 
1398
                        CLUTTER_PARAM_READWRITE);
1392
1399
 
1393
1400
  /**
1394
1401
   * ClutterBoxLayout:easing-duration:
1400
1407
   *
1401
1408
   * Since: 1.2
1402
1409
   */
1403
 
  pspec = g_param_spec_uint ("easing-duration",
1404
 
                             P_("Easing Duration"),
1405
 
                             P_("The duration of the animations"),
1406
 
                             0, G_MAXUINT,
1407
 
                             500,
1408
 
                             CLUTTER_PARAM_READWRITE);
1409
 
  g_object_class_install_property (gobject_class, PROP_EASING_DURATION, pspec);
 
1410
  obj_props[PROP_EASING_DURATION] =
 
1411
    g_param_spec_uint ("easing-duration",
 
1412
                       P_("Easing Duration"),
 
1413
                       P_("The duration of the animations"),
 
1414
                       0, G_MAXUINT,
 
1415
                       500,
 
1416
                       CLUTTER_PARAM_READWRITE);
 
1417
 
 
1418
  gobject_class->set_property = clutter_box_layout_set_property;
 
1419
  gobject_class->get_property = clutter_box_layout_get_property;
 
1420
  g_object_class_install_properties (gobject_class, PROP_LAST, obj_props);
1410
1421
}
1411
1422
 
1412
1423
static void