[gnome-shell] Handle adding children to StTable from Javascript



commit af3ec56ca13111372801d956a75886b3b33420dc
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Wed Sep 30 00:04:42 2009 -0400

    Handle adding children to StTable from Javascript
    
    Remove the StTable specific methods to add actors:
    
     st_table_add_actor()
     st_table_add_actor_with_properties()
    
    Since they shadow the generic ClutterContainer add_actor() method,
    and patch in our add() convenience function as we do for
    StBoxLayout.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=596811

 js/ui/environment.js |    1 +
 src/st/st-table.c    |   93 --------------------------------------------------
 src/st/st-table.h    |   11 ------
 3 files changed, 1 insertions(+), 104 deletions(-)
---
diff --git a/js/ui/environment.js b/js/ui/environment.js
index 01e2246..718b1f1 100644
--- a/js/ui/environment.js
+++ b/js/ui/environment.js
@@ -26,6 +26,7 @@ function _patchContainerClass(containerClass) {
 }
 
 _patchContainerClass(St.BoxLayout);
+_patchContainerClass(St.Table);
 
 function init() {
     Tweener.init();
diff --git a/src/st/st-table.c b/src/st/st-table.c
index 9a0a18b..b1f9622 100644
--- a/src/st/st-table.c
+++ b/src/st/st-table.c
@@ -1350,99 +1350,6 @@ st_table_get_col_spacing (StTable *table)
 }
 
 /**
- * st_table_add_actor:
- * @table: a #StTable
- * @actor: the child to insert
- * @row: the row to place the child into
- * @column: the column to place the child into
- *
- * Add an actor at the specified row and column
- *
- * Note, column and rows numbers start from zero
- */
-void
-st_table_add_actor (StTable      *table,
-                    ClutterActor *actor,
-                    gint          row,
-                    gint          column)
-{
-  StTableChild *meta;
-  ClutterContainer *container;
-
-  g_return_if_fail (ST_IS_TABLE (table));
-  g_return_if_fail (CLUTTER_IS_ACTOR (actor));
-  g_return_if_fail (row >= -1);
-  g_return_if_fail (column >= -1);
-
-  if (row < 0)
-    row = table->priv->n_rows + 1;
-
-  if (column < 0)
-    column = table->priv->n_cols + 1;
-
-  container = CLUTTER_CONTAINER (table);
-  clutter_container_add_actor (container, actor);
-
-  meta = (StTableChild *) clutter_container_get_child_meta (container, actor);
-  meta->row = row;
-  meta->col = column;
-  _st_table_update_row_col (table, row, column);
-
-  clutter_actor_queue_relayout (CLUTTER_ACTOR (table));
-}
-
-/**
- * st_table_add_actor_with_properties
- * @table: a #StTable
- * @actor: the child #ClutterActor
- * @row: the row to place the child into
- * @column: the column to place the child into
- * @first_property_name: name of the first property to set
- * @...: value for the first property, followed optionally by more name/value pairs terminated with NULL.
- *
- * Add an actor into at the specified row and column, with additional child
- * properties to set.
- */
-void
-st_table_add_actor_with_properties (StTable      *table,
-                                    ClutterActor *actor,
-                                    gint          row,
-                                    gint          column,
-                                    const gchar  *first_property_name,
-                                    ...)
-{
-  va_list args;
-  StTableChild *meta;
-  ClutterContainer *container;
-
-  g_return_if_fail (ST_IS_TABLE (table));
-  g_return_if_fail (CLUTTER_IS_ACTOR (actor));
-  g_return_if_fail (row >= -1);
-  g_return_if_fail (column >= -1);
-  g_return_if_fail (first_property_name != NULL);
-
-  if (row < 0)
-    row = table->priv->n_rows + 1;
-
-  if (column < 0)
-    column = table->priv->n_cols + 1;
-
-  container = (ClutterContainer *) table;
-  clutter_container_add_actor (container, actor);
-
-  meta = (StTableChild *) clutter_container_get_child_meta (container, actor);
-  meta->row = row;
-  meta->col = column;
-  _st_table_update_row_col (table, row, column);
-
-  va_start (args, first_property_name);
-  g_object_set_valist ((GObject*) meta, first_property_name, args);
-  va_end (args);
-
-  clutter_actor_queue_relayout (CLUTTER_ACTOR (table));
-}
-
-/**
  * st_table_get_row_count:
  * @table: A #StTable
  *
diff --git a/src/st/st-table.h b/src/st/st-table.h
index 9da27d1..f95e4d6 100644
--- a/src/st/st-table.h
+++ b/src/st/st-table.h
@@ -93,17 +93,6 @@ void st_table_set_row_spacing (StTable      *table,
                                gint          spacing);
 gint st_table_get_col_spacing (StTable      *table);
 gint st_table_get_row_spacing (StTable      *table);
-void st_table_add_actor       (StTable      *table,
-                               ClutterActor *actor,
-                               gint          row,
-                               gint          column);
-
-void st_table_add_actor_with_properties (StTable      *table,
-                                         ClutterActor *actor,
-                                         gint          row,
-                                         gint          column,
-                                         const gchar  *first_property_name,
-                                         ...);
 
 gint st_table_get_row_count    (StTable *table);
 gint st_table_get_column_count (StTable *table);



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