[mutter/wip/nielsdg/clutter-remove-deprecated: 5/6] Clutter: remove deprecated ClutterBox



commit 156aa3dd998f01c2bf4ef115876e416f5a51a919
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Sat Nov 17 15:27:01 2018 +0100

    Clutter: remove deprecated ClutterBox

 clutter/clutter/Makefile.am                        |   2 -
 clutter/clutter/clutter-deprecated.h               |   1 -
 clutter/clutter/deprecated/clutter-box.c           | 745 ---------------------
 clutter/clutter/deprecated/clutter-box.h           | 143 ----
 clutter/clutter/meson.build                        |   2 -
 clutter/tests/conform/script-parser.c              |  19 +-
 .../scripts/test-script-layout-property.json       |   2 +-
 .../conform/scripts/test-script-named-object.json  |   9 +-
 .../scripts/test-script-object-property.json       |   4 +-
 clutter/tests/interactive/test-swipe-action.c      |  32 +-
 clutter/tests/interactive/test-texture-material.c  |   3 +-
 11 files changed, 30 insertions(+), 932 deletions(-)
---
diff --git a/clutter/clutter/Makefile.am b/clutter/clutter/Makefile.am
index 25b06acaf..6d96a4a1c 100644
--- a/clutter/clutter/Makefile.am
+++ b/clutter/clutter/Makefile.am
@@ -267,7 +267,6 @@ deprecated_h = \
        deprecated/clutter-behaviour-rotate.h   \
        deprecated/clutter-behaviour-scale.h            \
        deprecated/clutter-bin-layout.h         \
-       deprecated/clutter-box.h                        \
        deprecated/clutter-cairo-texture.h              \
        deprecated/clutter-container.h          \
        deprecated/clutter-input-device.h               \
@@ -295,7 +294,6 @@ deprecated_c = \
        deprecated/clutter-behaviour-path.c             \
        deprecated/clutter-behaviour-rotate.c           \
        deprecated/clutter-behaviour-scale.c            \
-       deprecated/clutter-box.c                        \
        deprecated/clutter-cairo-texture.c              \
        deprecated/clutter-input-device-deprecated.c    \
        deprecated/clutter-layout-manager-deprecated.c \
diff --git a/clutter/clutter/clutter-deprecated.h b/clutter/clutter/clutter-deprecated.h
index 23e5a1ae7..558617ff5 100644
--- a/clutter/clutter/clutter-deprecated.h
+++ b/clutter/clutter/clutter-deprecated.h
@@ -17,7 +17,6 @@
 #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"
 #include "deprecated/clutter-input-device.h"
diff --git a/clutter/clutter/meson.build b/clutter/clutter/meson.build
index e94efb353..b16e7a231 100644
--- a/clutter/clutter/meson.build
+++ b/clutter/clutter/meson.build
@@ -227,7 +227,6 @@ clutter_deprecated_headers = [
   'deprecated/clutter-behaviour-rotate.h',
   'deprecated/clutter-behaviour-scale.h',
   'deprecated/clutter-bin-layout.h',
-  'deprecated/clutter-box.h',
   'deprecated/clutter-cairo-texture.h',
   'deprecated/clutter-container.h',
   'deprecated/clutter-input-device.h',
@@ -254,7 +253,6 @@ clutter_deprecated_sources = [
   'deprecated/clutter-behaviour-path.c',
   'deprecated/clutter-behaviour-rotate.c',
   'deprecated/clutter-behaviour-scale.c',
-  'deprecated/clutter-box.c',
   'deprecated/clutter-cairo-texture.c',
   'deprecated/clutter-input-device-deprecated.c',
   'deprecated/clutter-layout-manager-deprecated.c',
diff --git a/clutter/tests/conform/script-parser.c b/clutter/tests/conform/script-parser.c
index c2e2dbd08..4452e3fb1 100644
--- a/clutter/tests/conform/script-parser.c
+++ b/clutter/tests/conform/script-parser.c
@@ -251,10 +251,10 @@ script_object_property (void)
   g_assert_no_error (error);
 
   actor = clutter_script_get_object (script, "test");
-  g_assert (CLUTTER_IS_BOX (actor));
+  g_assert (CLUTTER_IS_ACTOR (actor));
 
-  manager = clutter_box_get_layout_manager (CLUTTER_BOX (actor));
-  g_assert (CLUTTER_IS_BIN_LAYOUT (manager));
+  manager = clutter_actor_get_layout_manager (CLUTTER_ACTOR (actor));
+  g_assert (CLUTTER_IS_BOX_LAYOUT (manager));
 
   g_object_unref (script);
   g_free (test_file);
@@ -277,11 +277,14 @@ script_named_object (void)
   g_assert_no_error (error);
 
   actor = clutter_script_get_object (script, "test");
-  g_assert (CLUTTER_IS_BOX (actor));
-
-  manager = clutter_box_get_layout_manager (CLUTTER_BOX (actor));
-  g_assert (CLUTTER_IS_BOX_LAYOUT (manager));
-  g_assert (clutter_box_layout_get_vertical (CLUTTER_BOX_LAYOUT (manager)));
+  g_assert (CLUTTER_IS_ACTOR (actor));
+
+  manager = clutter_actor_get_layout_manager (CLUTTER_ACTOR (actor));
+  g_assert (CLUTTER_IS_GRID_LAYOUT (manager));
+  g_assert_cmpuint (clutter_grid_layout_get_row_spacing (CLUTTER_GRID_LAYOUT (manager)),
+                    ==, 6);
+  g_assert_cmpuint (clutter_grid_layout_get_column_spacing (CLUTTER_GRID_LAYOUT (manager)),
+                    ==, 12);
 
   g_object_unref (script);
   g_free (test_file);
diff --git a/clutter/tests/conform/scripts/test-script-layout-property.json 
b/clutter/tests/conform/scripts/test-script-layout-property.json
index 17e9f4882..e16cd6ba6 100644
--- a/clutter/tests/conform/scripts/test-script-layout-property.json
+++ b/clutter/tests/conform/scripts/test-script-layout-property.json
@@ -2,7 +2,7 @@
   { "id" : "manager", "type" : "ClutterBoxLayout" },
 
   {
-    "id" : "container", "type" : "ClutterBox",
+    "id" : "container", "type" : "ClutterActor",
     "layout-manager" : "manager",
     "children" : [
       {
diff --git a/clutter/tests/conform/scripts/test-script-named-object.json 
b/clutter/tests/conform/scripts/test-script-named-object.json
index 6611b62a4..edfd5462c 100644
--- a/clutter/tests/conform/scripts/test-script-named-object.json
+++ b/clutter/tests/conform/scripts/test-script-named-object.json
@@ -1,10 +1,9 @@
 [
   {
     "id" : "layout",
-    "type" : "ClutterBoxLayout",
-    "orientation" : "vertical",
-    "spacing" : 12,
-    "pack-start" : false
+    "type" : "ClutterGridLayout",
+    "row-spacing" : 6,
+    "column-spacing" : 12
   },
   {
     "type" : "ClutterStage",
@@ -12,7 +11,7 @@
     "children" : [
       {
         "id" : "test",
-        "type" : "ClutterBox",
+        "type" : "ClutterActor",
         "layout-manager" : "layout",
         "children" : [
           {
diff --git a/clutter/tests/conform/scripts/test-script-object-property.json 
b/clutter/tests/conform/scripts/test-script-object-property.json
index 18a02fb8b..73923b925 100644
--- a/clutter/tests/conform/scripts/test-script-object-property.json
+++ b/clutter/tests/conform/scripts/test-script-object-property.json
@@ -1,7 +1,7 @@
 {
   "id" : "test",
-  "type" : "ClutterBox",
-  "layout-manager" : { "id" : "layout", "type" : "ClutterBinLayout" },
+  "type" : "ClutterActor",
+  "layout-manager" : { "id" : "layout", "type" : "ClutterBoxLayout" },
   "children" : [
     {
       "id" : "child-1",
diff --git a/clutter/tests/interactive/test-swipe-action.c b/clutter/tests/interactive/test-swipe-action.c
index 75b2e75d5..56a7ffacb 100644
--- a/clutter/tests/interactive/test-swipe-action.c
+++ b/clutter/tests/interactive/test-swipe-action.c
@@ -128,44 +128,32 @@ test_swipe_action_main (int argc, char *argv[])
   attach_action (rect, BOTH);
 
   {
-    ClutterLayoutManager *layout = clutter_box_layout_new ();
+    ClutterLayoutManager *layout = clutter_grid_layout_new ();
     ClutterActor *box, *label;
     float offset;
 
-    clutter_box_layout_set_vertical (CLUTTER_BOX_LAYOUT (layout), TRUE);
-    clutter_box_layout_set_spacing (CLUTTER_BOX_LAYOUT (layout), 6);
+    clutter_grid_layout_set_orientation (CLUTTER_GRID_LAYOUT (layout),
+                                         CLUTTER_ORIENTATION_VERTICAL);
+    clutter_grid_layout_set_row_spacing (CLUTTER_GRID_LAYOUT (layout), 6);
+    clutter_grid_layout_set_column_spacing (CLUTTER_GRID_LAYOUT (layout), 6);
 
-    box = clutter_box_new (layout);
+    box = clutter_actor_new ();
+    clutter_actor_set_layout_manager (box, layout);
 
     label = clutter_text_new ();
     clutter_text_set_markup (CLUTTER_TEXT (label),
                              "<b>Red</b>: vertical swipes only");
-    clutter_box_layout_pack (CLUTTER_BOX_LAYOUT (layout),
-                             label,
-                             TRUE,
-                             TRUE, TRUE,
-                             CLUTTER_BOX_ALIGNMENT_START,
-                             CLUTTER_BOX_ALIGNMENT_CENTER);
+    clutter_actor_add_child (box, label);
 
     label = clutter_text_new ();
     clutter_text_set_markup (CLUTTER_TEXT (label),
                              "<b>Blue</b>: horizontal swipes only");
-    clutter_box_layout_pack (CLUTTER_BOX_LAYOUT (layout),
-                             label,
-                             TRUE,
-                             TRUE, TRUE,
-                             CLUTTER_BOX_ALIGNMENT_START,
-                             CLUTTER_BOX_ALIGNMENT_CENTER);
+    clutter_actor_add_child (box, label);
 
     label = clutter_text_new ();
     clutter_text_set_markup (CLUTTER_TEXT (label),
                              "<b>Green</b>: both");
-    clutter_box_layout_pack (CLUTTER_BOX_LAYOUT (layout),
-                             label,
-                             TRUE,
-                             TRUE, TRUE,
-                             CLUTTER_BOX_ALIGNMENT_START,
-                             CLUTTER_BOX_ALIGNMENT_CENTER);
+    clutter_actor_add_child (box, label);
 
     offset = clutter_actor_get_height (stage)
            - clutter_actor_get_height (box)
diff --git a/clutter/tests/interactive/test-texture-material.c 
b/clutter/tests/interactive/test-texture-material.c
index 4886ce03a..b54e72899 100644
--- a/clutter/tests/interactive/test-texture-material.c
+++ b/clutter/tests/interactive/test-texture-material.c
@@ -18,7 +18,8 @@ test_texture_material_main (int argc, char *argv[])
   g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
 
   manager = clutter_flow_layout_new (CLUTTER_FLOW_HORIZONTAL);
-  box = clutter_box_new (manager);
+  box = clutter_actor_new ();
+  clutter_actor_set_layout_manager (box, manager);
   clutter_actor_add_constraint (box, clutter_bind_constraint_new (stage, CLUTTER_BIND_WIDTH, -25.0));
   clutter_actor_add_constraint (box, clutter_bind_constraint_new (stage, CLUTTER_BIND_HEIGHT, -25.0));
   clutter_actor_set_position (box, 25.0, 25.0);


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