]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkwidgetpath.c
Drop the Motif DND protocol
[~andy/gtk] / gtk / gtkwidgetpath.c
index bdbb7d0b2d4c237d7cd2a03a4aa8ae7fdea0b279..855902fd6835e09ebb35d4f9659bb294ab692962 100644 (file)
@@ -12,9 +12,7 @@
  * 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, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
@@ -176,15 +174,16 @@ gtk_widget_path_copy (const GtkWidgetPath *path)
 
   new_path = gtk_widget_path_new ();
 
+  g_array_set_size (new_path->elems, path->elems->len);
+
   for (i = 0; i < path->elems->len; i++)
     {
-      GtkPathElement *elem, new;
+      GtkPathElement *elem, *dest;
 
       elem = &g_array_index (path->elems, GtkPathElement, i);
+      dest = &g_array_index (new_path->elems, GtkPathElement, i);
 
-      gtk_path_element_copy (&new, elem);
-
-      g_array_append_val (new_path->elems, new);
+      gtk_path_element_copy (dest, elem);
     }
 
   return new_path;
@@ -328,6 +327,12 @@ gtk_widget_path_to_string (const GtkWidgetPath *path)
           g_string_append_c (string, ')');
         }
 
+
+      if (elem->siblings)
+        g_string_append_printf (string, "[%d/%d]",
+                                elem->sibling_index + 1,
+                                gtk_widget_path_length (elem->siblings));
+
       if (elem->classes)
         {
           for (j = 0; j < elem->classes->len; j++)
@@ -351,6 +356,7 @@ gtk_widget_path_to_string (const GtkWidgetPath *path)
                 "odd",
                 "first",
                 "last",
+                "only",
                 "sorted"
               };