Index: libegg/eggaccelerators.c
===================================================================
--- libegg/eggaccelerators.c	(revision 3787)
+++ libegg/eggaccelerators.c	(arbetskopia)
@@ -1,657 +0,0 @@
-/* eggaccelerators.c
- * Copyright (C) 2002  Red Hat, Inc.; Copyright 1998, 2001 Tim Janik
- * Developed by Havoc Pennington, Tim Janik
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "eggaccelerators.h"
-
-#include <string.h>
-#include <gdk/gdkx.h>
-#include <gdk/gdkkeysyms.h>
-
-enum
-{
-  EGG_MODMAP_ENTRY_SHIFT   = 0,
-  EGG_MODMAP_ENTRY_LOCK    = 1,
-  EGG_MODMAP_ENTRY_CONTROL = 2,
-  EGG_MODMAP_ENTRY_MOD1    = 3,
-  EGG_MODMAP_ENTRY_MOD2    = 4,
-  EGG_MODMAP_ENTRY_MOD3    = 5,
-  EGG_MODMAP_ENTRY_MOD4    = 6,
-  EGG_MODMAP_ENTRY_MOD5    = 7,
-  EGG_MODMAP_ENTRY_LAST    = 8
-};
-
-#define MODMAP_ENTRY_TO_MODIFIER(x) (1 << (x))
-
-typedef struct
-{
-  EggVirtualModifierType mapping[EGG_MODMAP_ENTRY_LAST];
-
-} EggModmap;
-
-const EggModmap* egg_keymap_get_modmap (GdkKeymap *keymap);
-
-static inline gboolean
-is_alt (const gchar *string)
-{
-  return ((string[0] == '<') &&
-	  (string[1] == 'a' || string[1] == 'A') &&
-	  (string[2] == 'l' || string[2] == 'L') &&
-	  (string[3] == 't' || string[3] == 'T') &&
-	  (string[4] == '>'));
-}
-
-static inline gboolean
-is_ctl (const gchar *string)
-{
-  return ((string[0] == '<') &&
-	  (string[1] == 'c' || string[1] == 'C') &&
-	  (string[2] == 't' || string[2] == 'T') &&
-	  (string[3] == 'l' || string[3] == 'L') &&
-	  (string[4] == '>'));
-}
-
-static inline gboolean
-is_modx (const gchar *string)
-{
-  return ((string[0] == '<') &&
-	  (string[1] == 'm' || string[1] == 'M') &&
-	  (string[2] == 'o' || string[2] == 'O') &&
-	  (string[3] == 'd' || string[3] == 'D') &&
-	  (string[4] >= '1' && string[4] <= '5') &&
-	  (string[5] == '>'));
-}
-
-static inline gboolean
-is_ctrl (const gchar *string)
-{
-  return ((string[0] == '<') &&
-	  (string[1] == 'c' || string[1] == 'C') &&
-	  (string[2] == 't' || string[2] == 'T') &&
-	  (string[3] == 'r' || string[3] == 'R') &&
-	  (string[4] == 'l' || string[4] == 'L') &&
-	  (string[5] == '>'));
-}
-
-static inline gboolean
-is_shft (const gchar *string)
-{
-  return ((string[0] == '<') &&
-	  (string[1] == 's' || string[1] == 'S') &&
-	  (string[2] == 'h' || string[2] == 'H') &&
-	  (string[3] == 'f' || string[3] == 'F') &&
-	  (string[4] == 't' || string[4] == 'T') &&
-	  (string[5] == '>'));
-}
-
-static inline gboolean
-is_shift (const gchar *string)
-{
-  return ((string[0] == '<') &&
-	  (string[1] == 's' || string[1] == 'S') &&
-	  (string[2] == 'h' || string[2] == 'H') &&
-	  (string[3] == 'i' || string[3] == 'I') &&
-	  (string[4] == 'f' || string[4] == 'F') &&
-	  (string[5] == 't' || string[5] == 'T') &&
-	  (string[6] == '>'));
-}
-
-static inline gboolean
-is_control (const gchar *string)
-{
-  return ((string[0] == '<') &&
-	  (string[1] == 'c' || string[1] == 'C') &&
-	  (string[2] == 'o' || string[2] == 'O') &&
-	  (string[3] == 'n' || string[3] == 'N') &&
-	  (string[4] == 't' || string[4] == 'T') &&
-	  (string[5] == 'r' || string[5] == 'R') &&
-	  (string[6] == 'o' || string[6] == 'O') &&
-	  (string[7] == 'l' || string[7] == 'L') &&
-	  (string[8] == '>'));
-}
-
-static inline gboolean
-is_release (const gchar *string)
-{
-  return ((string[0] == '<') &&
-	  (string[1] == 'r' || string[1] == 'R') &&
-	  (string[2] == 'e' || string[2] == 'E') &&
-	  (string[3] == 'l' || string[3] == 'L') &&
-	  (string[4] == 'e' || string[4] == 'E') &&
-	  (string[5] == 'a' || string[5] == 'A') &&
-	  (string[6] == 's' || string[6] == 'S') &&
-	  (string[7] == 'e' || string[7] == 'E') &&
-	  (string[8] == '>'));
-}
-
-static inline gboolean
-is_meta (const gchar *string)
-{
-  return ((string[0] == '<') &&
-	  (string[1] == 'm' || string[1] == 'M') &&
-	  (string[2] == 'e' || string[2] == 'E') &&
-	  (string[3] == 't' || string[3] == 'T') &&
-	  (string[4] == 'a' || string[4] == 'A') &&
-	  (string[5] == '>'));
-}
-
-static inline gboolean
-is_super (const gchar *string)
-{
-  return ((string[0] == '<') &&
-	  (string[1] == 's' || string[1] == 'S') &&
-	  (string[2] == 'u' || string[2] == 'U') &&
-	  (string[3] == 'p' || string[3] == 'P') &&
-	  (string[4] == 'e' || string[4] == 'E') &&
-	  (string[5] == 'r' || string[5] == 'R') &&
-	  (string[6] == '>'));
-}
-
-static inline gboolean
-is_hyper (const gchar *string)
-{
-  return ((string[0] == '<') &&
-	  (string[1] == 'h' || string[1] == 'H') &&
-	  (string[2] == 'y' || string[2] == 'Y') &&
-	  (string[3] == 'p' || string[3] == 'P') &&
-	  (string[4] == 'e' || string[4] == 'E') &&
-	  (string[5] == 'r' || string[5] == 'R') &&
-	  (string[6] == '>'));
-}
-
-/**
- * egg_accelerator_parse_virtual:
- * @accelerator:      string representing an accelerator
- * @accelerator_key:  return location for accelerator keyval
- * @accelerator_mods: return location for accelerator modifier mask
- *
- * Parses a string representing a virtual accelerator. The format
- * looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1" or
- * "&lt;Release&gt;z" (the last one is for key release).  The parser
- * is fairly liberal and allows lower or upper case, and also
- * abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;".
- *
- * If the parse fails, @accelerator_key and @accelerator_mods will
- * be set to 0 (zero) and %FALSE will be returned. If the string contains
- * only modifiers, @accelerator_key will be set to 0 but %TRUE will be
- * returned.
- *
- * The virtual vs. concrete accelerator distinction is a relic of
- * how the X Window System works; there are modifiers Mod2-Mod5 that
- * can represent various keyboard keys (numlock, meta, hyper, etc.),
- * the virtual modifier represents the keyboard key, the concrete
- * modifier the actual Mod2-Mod5 bits in the key press event.
- * 
- * Returns: %TRUE on success.
- */
-gboolean
-egg_accelerator_parse_virtual (const gchar            *accelerator,
-                               guint                  *accelerator_key,
-                               EggVirtualModifierType *accelerator_mods)
-{
-  guint keyval;
-  GdkModifierType mods;
-  gint len;
-  gboolean bad_keyval;
-  
-  if (accelerator_key)
-    *accelerator_key = 0;
-  if (accelerator_mods)
-    *accelerator_mods = 0;
-
-  g_return_val_if_fail (accelerator != NULL, FALSE);
-
-  bad_keyval = FALSE;
-  
-  keyval = 0;
-  mods = 0;
-  len = strlen (accelerator);
-  while (len)
-    {
-      if (*accelerator == '<')
-	{
-	  if (len >= 9 && is_release (accelerator))
-	    {
-	      accelerator += 9;
-	      len -= 9;
-	      mods |= EGG_VIRTUAL_RELEASE_MASK;
-	    }
-	  else if (len >= 9 && is_control (accelerator))
-	    {
-	      accelerator += 9;
-	      len -= 9;
-	      mods |= EGG_VIRTUAL_CONTROL_MASK;
-	    }
-	  else if (len >= 7 && is_shift (accelerator))
-	    {
-	      accelerator += 7;
-	      len -= 7;
-	      mods |= EGG_VIRTUAL_SHIFT_MASK;
-	    }
-	  else if (len >= 6 && is_shft (accelerator))
-	    {
-	      accelerator += 6;
-	      len -= 6;
-	      mods |= EGG_VIRTUAL_SHIFT_MASK;
-	    }
-	  else if (len >= 6 && is_ctrl (accelerator))
-	    {
-	      accelerator += 6;
-	      len -= 6;
-	      mods |= EGG_VIRTUAL_CONTROL_MASK;
-	    }
-	  else if (len >= 6 && is_modx (accelerator))
-	    {
-	      static const guint mod_vals[] = {
-		EGG_VIRTUAL_ALT_MASK, EGG_VIRTUAL_MOD2_MASK, EGG_VIRTUAL_MOD3_MASK,
-		EGG_VIRTUAL_MOD4_MASK, EGG_VIRTUAL_MOD5_MASK
-	      };
-
-	      len -= 6;
-	      accelerator += 4;
-	      mods |= mod_vals[*accelerator - '1'];
-	      accelerator += 2;
-	    }
-	  else if (len >= 5 && is_ctl (accelerator))
-	    {
-	      accelerator += 5;
-	      len -= 5;
-	      mods |= EGG_VIRTUAL_CONTROL_MASK;
-	    }
-	  else if (len >= 5 && is_alt (accelerator))
-	    {
-	      accelerator += 5;
-	      len -= 5;
-	      mods |= EGG_VIRTUAL_ALT_MASK;
-	    }
-          else if (len >= 6 && is_meta (accelerator))
-	    {
-	      accelerator += 6;
-	      len -= 6;
-	      mods |= EGG_VIRTUAL_META_MASK;
-	    }
-          else if (len >= 7 && is_hyper (accelerator))
-	    {
-	      accelerator += 7;
-	      len -= 7;
-	      mods |= EGG_VIRTUAL_HYPER_MASK;
-	    }
-          else if (len >= 7 && is_super (accelerator))
-	    {
-	      accelerator += 7;
-	      len -= 7;
-	      mods |= EGG_VIRTUAL_SUPER_MASK;
-	    }
-	  else
-	    {
-	      gchar last_ch;
-	      
-	      last_ch = *accelerator;
-	      while (last_ch && last_ch != '>')
-		{
-		  last_ch = *accelerator;
-		  accelerator += 1;
-		  len -= 1;
-		}
-	    }
-	}
-      else
-	{
-          keyval = gdk_keyval_from_name (accelerator);
-          
-          if (keyval == 0)
-            bad_keyval = TRUE;
-          
-          accelerator += len;
-          len -= len;              
-	}
-    }
-  
-  if (accelerator_key)
-    *accelerator_key = gdk_keyval_to_lower (keyval);
-  if (accelerator_mods)
-    *accelerator_mods = mods;
-
-  return !bad_keyval;
-}
-
-
-/**
- * egg_virtual_accelerator_name:
- * @accelerator_key:  accelerator keyval
- * @accelerator_mods: accelerator modifier mask
- * @returns:          a newly-allocated accelerator name
- * 
- * Converts an accelerator keyval and modifier mask
- * into a string parseable by egg_accelerator_parse_virtual().
- * For example, if you pass in #GDK_q and #EGG_VIRTUAL_CONTROL_MASK,
- * this function returns "&lt;Control&gt;q".
- *
- * The caller of this function must free the returned string.
- */
-gchar*
-egg_virtual_accelerator_name (guint                  accelerator_key,
-                              EggVirtualModifierType accelerator_mods)
-{
-  static const gchar text_release[] = "<Release>";
-  static const gchar text_shift[] = "<Shift>";
-  static const gchar text_control[] = "<Control>";
-  static const gchar text_mod1[] = "<Alt>";
-  static const gchar text_mod2[] = "<Mod2>";
-  static const gchar text_mod3[] = "<Mod3>";
-  static const gchar text_mod4[] = "<Mod4>";
-  static const gchar text_mod5[] = "<Mod5>";
-  static const gchar text_meta[] = "<Meta>";
-  static const gchar text_super[] = "<Super>";
-  static const gchar text_hyper[] = "<Hyper>";
-  guint l;
-  gchar *keyval_name;
-  gchar *accelerator;
-
-  accelerator_mods &= EGG_VIRTUAL_MODIFIER_MASK;
-
-  keyval_name = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));
-  if (!keyval_name)
-    keyval_name = "";
-
-  l = 0;
-  if (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)
-    l += sizeof (text_release) - 1;
-  if (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)
-    l += sizeof (text_shift) - 1;
-  if (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)
-    l += sizeof (text_control) - 1;
-  if (accelerator_mods & EGG_VIRTUAL_ALT_MASK)
-    l += sizeof (text_mod1) - 1;
-  if (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)
-    l += sizeof (text_mod2) - 1;
-  if (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)
-    l += sizeof (text_mod3) - 1;
-  if (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)
-    l += sizeof (text_mod4) - 1;
-  if (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)
-    l += sizeof (text_mod5) - 1;
-  if (accelerator_mods & EGG_VIRTUAL_META_MASK)
-    l += sizeof (text_meta) - 1;
-  if (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)
-    l += sizeof (text_hyper) - 1;
-  if (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)
-    l += sizeof (text_super) - 1;
-  l += strlen (keyval_name);
-
-  accelerator = g_new (gchar, l + 1);
-
-  l = 0;
-  accelerator[l] = 0;
-  if (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)
-    {
-      strcpy (accelerator + l, text_release);
-      l += sizeof (text_release) - 1;
-    }
-  if (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)
-    {
-      strcpy (accelerator + l, text_shift);
-      l += sizeof (text_shift) - 1;
-    }
-  if (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)
-    {
-      strcpy (accelerator + l, text_control);
-      l += sizeof (text_control) - 1;
-    }
-  if (accelerator_mods & EGG_VIRTUAL_ALT_MASK)
-    {
-      strcpy (accelerator + l, text_mod1);
-      l += sizeof (text_mod1) - 1;
-    }
-  if (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)
-    {
-      strcpy (accelerator + l, text_mod2);
-      l += sizeof (text_mod2) - 1;
-    }
-  if (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)
-    {
-      strcpy (accelerator + l, text_mod3);
-      l += sizeof (text_mod3) - 1;
-    }
-  if (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)
-    {
-      strcpy (accelerator + l, text_mod4);
-      l += sizeof (text_mod4) - 1;
-    }
-  if (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)
-    {
-      strcpy (accelerator + l, text_mod5);
-      l += sizeof (text_mod5) - 1;
-    }
-  if (accelerator_mods & EGG_VIRTUAL_META_MASK)
-    {
-      strcpy (accelerator + l, text_meta);
-      l += sizeof (text_meta) - 1;
-    }
-  if (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)
-    {
-      strcpy (accelerator + l, text_hyper);
-      l += sizeof (text_hyper) - 1;
-    }
-  if (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)
-    {
-      strcpy (accelerator + l, text_super);
-      l += sizeof (text_super) - 1;
-    }
-  
-  strcpy (accelerator + l, keyval_name);
-
-  return accelerator;
-}
-
-void
-egg_keymap_resolve_virtual_modifiers (GdkKeymap              *keymap,
-                                      EggVirtualModifierType  virtual_mods,
-                                      GdkModifierType        *concrete_mods)
-{
-  GdkModifierType concrete;
-  int i;
-  const EggModmap *modmap;
-
-  g_return_if_fail (GDK_IS_KEYMAP (keymap));
-  g_return_if_fail (concrete_mods != NULL);
-  
-  modmap = egg_keymap_get_modmap (keymap);
-  
-  /* Not so sure about this algorithm. */
-  
-  concrete = 0;
-  i = 0;
-  while (i < EGG_MODMAP_ENTRY_LAST)
-    {
-      if (modmap->mapping[i] & virtual_mods)
-        concrete |= (1 << i);
-
-      ++i;
-    }
-
-  *concrete_mods = concrete;
-}
-
-void
-egg_keymap_virtualize_modifiers (GdkKeymap              *keymap,
-                                 GdkModifierType         concrete_mods,
-                                 EggVirtualModifierType *virtual_mods)
-{
-  GdkModifierType virtual;
-  int i;
-  const EggModmap *modmap;
-  
-  g_return_if_fail (GDK_IS_KEYMAP (keymap));
-  g_return_if_fail (virtual_mods != NULL);
-
-  modmap = egg_keymap_get_modmap (keymap);
-  
-  /* Not so sure about this algorithm. */
-  
-  virtual = 0;
-  i = 0;
-  while (i < EGG_MODMAP_ENTRY_LAST)
-    {
-      if ((1 << i) & concrete_mods)
-        {
-          EggVirtualModifierType cleaned;
-          
-          cleaned = modmap->mapping[i] & ~(EGG_VIRTUAL_MOD2_MASK |
-                                           EGG_VIRTUAL_MOD3_MASK |
-                                           EGG_VIRTUAL_MOD4_MASK |
-                                           EGG_VIRTUAL_MOD5_MASK);
-          
-          if (cleaned != 0)
-            {
-              virtual |= cleaned;
-            }
-          else
-            {
-              /* Rather than dropping mod2->mod5 if not bound,
-               * go ahead and use the concrete names
-               */
-              virtual |= modmap->mapping[i];
-            }
-        }
-      
-      ++i;
-    }
-  
-  *virtual_mods = virtual;
-}
-
-static void
-reload_modmap (GdkKeymap *keymap,
-               EggModmap *modmap)
-{
-  XModifierKeymap *xmodmap;
-  int map_size;
-  int i;
-
-  /* FIXME multihead */
-  xmodmap = XGetModifierMapping (gdk_x11_get_default_xdisplay ());
-
-  memset (modmap->mapping, 0, sizeof (modmap->mapping));
-  
-  /* there are 8 modifiers, and the first 3 are shift, shift lock,
-   * and control
-   */
-  map_size = 8 * xmodmap->max_keypermod;
-  i = 3 * xmodmap->max_keypermod;
-  while (i < map_size)
-    {
-      /* get the key code at this point in the map,
-       * see if its keysym is one we're interested in
-       */
-      int keycode = xmodmap->modifiermap[i];
-      GdkKeymapKey *keys;
-      guint *keyvals;
-      int n_entries;
-      int j;
-      EggVirtualModifierType mask;
-      
-      keys = NULL;
-      keyvals = NULL;
-      n_entries = 0;
-
-      gdk_keymap_get_entries_for_keycode (keymap,
-                                          keycode,
-                                          &keys, &keyvals, &n_entries);
-      
-      mask = 0;
-      j = 0;
-      while (j < n_entries)
-        {          
-          if (keyvals[j] == GDK_Num_Lock)
-            mask |= EGG_VIRTUAL_NUM_LOCK_MASK;
-          else if (keyvals[j] == GDK_Scroll_Lock)
-            mask |= EGG_VIRTUAL_SCROLL_LOCK_MASK;
-          else if (keyvals[j] == GDK_Meta_L ||
-                   keyvals[j] == GDK_Meta_R)
-            mask |= EGG_VIRTUAL_META_MASK;
-          else if (keyvals[j] == GDK_Hyper_L ||
-                   keyvals[j] == GDK_Hyper_R)
-            mask |= EGG_VIRTUAL_HYPER_MASK;
-          else if (keyvals[j] == GDK_Super_L ||
-                   keyvals[j] == GDK_Super_R)
-            mask |= EGG_VIRTUAL_SUPER_MASK;
-          else if (keyvals[j] == GDK_Mode_switch)
-            mask |= EGG_VIRTUAL_MODE_SWITCH_MASK;
-          
-          ++j;
-        }
-
-      /* Mod1Mask is 1 << 3 for example, i.e. the
-       * fourth modifier, i / keyspermod is the modifier
-       * index
-       */      
-      modmap->mapping[i/xmodmap->max_keypermod] |= mask;
-      
-      g_free (keyvals);
-      g_free (keys);      
-      
-      ++i;
-    }
-
-  /* Add in the not-really-virtual fixed entries */
-  modmap->mapping[EGG_MODMAP_ENTRY_SHIFT] |= EGG_VIRTUAL_SHIFT_MASK;
-  modmap->mapping[EGG_MODMAP_ENTRY_CONTROL] |= EGG_VIRTUAL_CONTROL_MASK;
-  modmap->mapping[EGG_MODMAP_ENTRY_LOCK] |= EGG_VIRTUAL_LOCK_MASK;
-  modmap->mapping[EGG_MODMAP_ENTRY_MOD1] |= EGG_VIRTUAL_ALT_MASK;
-  modmap->mapping[EGG_MODMAP_ENTRY_MOD2] |= EGG_VIRTUAL_MOD2_MASK;
-  modmap->mapping[EGG_MODMAP_ENTRY_MOD3] |= EGG_VIRTUAL_MOD3_MASK;
-  modmap->mapping[EGG_MODMAP_ENTRY_MOD4] |= EGG_VIRTUAL_MOD4_MASK;
-  modmap->mapping[EGG_MODMAP_ENTRY_MOD5] |= EGG_VIRTUAL_MOD5_MASK;
-  
-  XFreeModifiermap (xmodmap);
-}
-
-const EggModmap*
-egg_keymap_get_modmap (GdkKeymap *keymap)
-{
-  EggModmap *modmap;
-
-  /* This is all a hack, much simpler when we can just
-   * modify GDK directly.
-   */
-  
-  modmap = g_object_get_data (G_OBJECT (keymap),
-                              "egg-modmap");
-
-  if (modmap == NULL)
-    {
-      modmap = g_new0 (EggModmap, 1);
-
-      /* FIXME modify keymap change events with an event filter
-       * and force a reload if we get one
-       */
-      
-      reload_modmap (keymap, modmap);
-      
-      g_object_set_data_full (G_OBJECT (keymap),
-                              "egg-modmap",
-                              modmap,
-                              g_free);
-    }
-
-  g_assert (modmap != NULL);
-  
-  return modmap;
-}
Index: libegg/test-tree-utils.c
===================================================================
--- libegg/test-tree-utils.c	(revision 3787)
+++ libegg/test-tree-utils.c	(arbetskopia)
@@ -1,343 +0,0 @@
-#include <gtk/gtk.h>
-#include <stdio.h>
-#include "eggtreeviewstate.h"
-#include "eggcellrendererkeys.h"
-
-#if 0
-#include "eggnodestate.h"
-#endif
-
-typedef GtkWidget *(* CreateWindowFunc) (void);
-
-const char state_string[] = ""
-"<treeview_state>"
-"  <treeview headers_visible=\"true\" search_column=\"0\">"
-"    <column title=\"Test first\" fixed_width=\"150\" resizable=\"true\" sizing=\"fixed\">"
-"      <cell text=\"Sliff sloff\" type=\"GtkCellRendererText\" />"
-"    </column>"
-"    <column title=\"Test\" reorderable=\"true\" sizing=\"autosize\">"
-"      <cell type=\"GtkCellRendererToggle\" expand=\"false\" active=\"model:1\"/>"
-"      <cell type=\"GtkCellRendererText\" text=\"model:0\"/>"
-"    </column>"
-"  </treeview>"
-"</treeview_state>";
-
-static GtkWidget *
-state_test (void)
-{
-  GtkWidget *window, *sw, *view;
-  GtkListStore *store;
-  GtkTreeIter iter;
-  GError *error = NULL;
-
-  egg_tree_view_state_add_cell_renderer_type (GTK_TYPE_CELL_RENDERER_TOGGLE);
-  
-  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-
-  store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_BOOLEAN);
-
-  gtk_list_store_append (store, &iter);
-  gtk_list_store_set (store, &iter,
-		      0, "Test string",
-		      1, TRUE,
-		      -1);
-  gtk_list_store_append (store, &iter);
-  gtk_list_store_set (store, &iter,
-		      0, "Another string",
-		      1, FALSE,
-		      -1);
-
-  sw = gtk_scrolled_window_new (NULL, NULL);
-  gtk_container_add (GTK_CONTAINER (window), sw);
-  view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
-
-  if (!egg_tree_view_state_apply_from_string (GTK_TREE_VIEW (view), state_string, &error))
-    {
-      g_print ("error: %s\n", error->message);
-    }
-  
-  gtk_container_add (GTK_CONTAINER (sw), view);
-  
-  return window;
-}
-
-static GtkWidget *
-progress_bar_test (void)
-{
-  GtkWidget *window;
-
-  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-
-  return window;
-}
-
-#if 0
-static void
-node_state_save (GtkWidget *button, GtkTreeView *tree_view)
-{
-	gboolean ret;
-
-	ret = egg_node_state_save_to_file (tree_view, "treeviewnodestate.xml");
-}
-
-static void
-node_state_restore (GtkWidget *button, GtkTreeView *tree_view)
-{
-	gboolean ret;
-
-	ret = egg_node_state_restore_from_file (tree_view,
-						"treeviewnodestate.xml");
-}
-
-static GtkWidget *
-node_state_test (void)
-{
-	GtkWidget *window, *sw, *tv, *hbox, *vbox, *button;
-	GtkTreeStore *store;
-	GtkTreeViewColumn *column;
-	GtkCellRenderer *rend;
-	gint i;
-
-	/* create window */
-	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-
-	vbox = gtk_vbox_new (FALSE, 3);
-	gtk_container_add (GTK_CONTAINER (window), vbox);
-
-	sw = gtk_scrolled_window_new (NULL, NULL);
-	gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
-
-	store = gtk_tree_store_new (1, G_TYPE_STRING);
-	tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
-
-	column = gtk_tree_view_column_new ();
-	rend = gtk_cell_renderer_text_new ();
-	gtk_tree_view_column_pack_start (column, rend,
-					 TRUE);
-	gtk_tree_view_column_set_attributes (column, rend,
-					     "text", 0,
-					     NULL);
-	gtk_tree_view_append_column (GTK_TREE_VIEW (tv), column);
-
-	gtk_container_add (GTK_CONTAINER (sw), tv);
-
-	hbox = gtk_hbox_new (TRUE, 2);
-	gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
-
-	button = gtk_button_new_with_label ("Save");
-	g_signal_connect (button, "clicked", G_CALLBACK (node_state_save), tv);
-	gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
-
-	button = gtk_button_new_with_label ("Restore");
-	g_signal_connect (button, "clicked", G_CALLBACK (node_state_restore),
-			  tv);
-	gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
-
-	/* fill the model */
-	for (i = 0; i < 6; i++) {
-		GtkTreeIter iter;
-		gchar text[16];
-		gint j;
-
-		sprintf (text, "%d", i);
-
-		gtk_tree_store_append (store, &iter, NULL);
-		gtk_tree_store_set (store, &iter, 0, text, -1);
-
-		for (j = 0; j < 3; j++) {
-			gint k;
-			GtkTreeIter iter2;
-
-			sprintf (text, "%d:%d", i, j);
-
-			gtk_tree_store_append (store, &iter2, &iter);
-			gtk_tree_store_set (store, &iter2, 0, text, -1);
-
-			for (k = 0; k < 2; k++) {
-				GtkTreeIter iter3;
-
-				sprintf (text, "%d:%d:%d", i, j, k);
-
-				gtk_tree_store_append (store, &iter3, &iter2);
-				gtk_tree_store_set (store, &iter3,
-						    0, text, -1);
-			}
-		}
-	}
-
-	/* done */
-
-	return window;
-}
-
-#endif
-
-
-static void
-accel_edited_callback (GtkCellRendererText *cell,
-                       const char          *path_string,
-                       guint                keyval,
-                       GdkModifierType      mask,
-                       guint                hardware_keycode,
-                       gpointer             data)
-{
-  GtkTreeModel *model = (GtkTreeModel *)data;
-  GtkTreePath *path = gtk_tree_path_new_from_string (path_string);
-  GtkTreeIter iter;
-
-  gtk_tree_model_get_iter (model, &iter, path);
-
-  g_print ("%u %d %u\n", keyval, mask, hardware_keycode);
-  
-  gtk_list_store_set (GTK_LIST_STORE (model), &iter,
-		      0, (gint)mask,
-		      1, keyval,
-		      -1);
-  gtk_tree_path_free (path);
-}
-
-static GtkWidget *
-key_test (void)
-{
-	GtkWidget *window, *sw, *tv;
-	GtkListStore *store;
-	GtkTreeViewColumn *column;
-	GtkCellRenderer *rend;
-	gint i;
-
-	/* create window */
-	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-
-
-	sw = gtk_scrolled_window_new (NULL, NULL);
-	gtk_container_add (GTK_CONTAINER (window), sw);
-
-	store = gtk_list_store_new (2, G_TYPE_INT, G_TYPE_UINT);
-	tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
-	gtk_container_add (GTK_CONTAINER (sw), tv);
-	column = gtk_tree_view_column_new ();
-	rend = egg_cell_renderer_keys_new ();
-	g_object_set (G_OBJECT (rend), "accel_mode", EGG_CELL_RENDERER_KEYS_MODE_X, NULL);
-	g_signal_connect (G_OBJECT (rend),
-			  "keys_edited",
-			  G_CALLBACK (accel_edited_callback),
-			  store);
-
-	g_object_set (G_OBJECT (rend), "editable", TRUE, NULL);
-	gtk_tree_view_column_pack_start (column, rend,
-					 TRUE);
-	gtk_tree_view_column_set_attributes (column, rend,
-					     "accel_mask", 0,
-					     "accel_key", 1,
-					     NULL);
-	gtk_tree_view_append_column (GTK_TREE_VIEW (tv), column);
-
-	for (i = 0; i < 10; i++) {
-		GtkTreeIter iter;
-
-		gtk_list_store_append (store, &iter);
-	}
-
-	/* done */
-
-	return window;
-}
-
-struct
-{
-  char *name;
-  CreateWindowFunc create_func;
-} entries[] =
-{
-  { "EggCellRendererKeys", key_test },
-#if 0
-  { "EggNodeState", node_state_test },
-#endif
-  { "Progress Bar Cell", progress_bar_test },
-  { "Tree View State", state_test },
-};
-
-
-static void
-row_activated (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column)
-{
-  GtkTreeIter iter;
-  GtkTreeModel *model;
-  CreateWindowFunc func;
-  GtkWidget *window;
-  char *str;
-  
-  model = gtk_tree_view_get_model (tree_view);
-  
-  gtk_tree_model_get_iter (model, &iter, path);
-
-  gtk_tree_model_get (model, &iter,
-		      0, &str,
-		      1, &func,
-		      -1);
-
-
-  window = (*func) ();
-  gtk_window_set_title (GTK_WINDOW (window), str);
-  gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
-  g_free (str);
-  
-  g_signal_connect (window, "delete_event",
-		    G_CALLBACK (gtk_widget_destroy), NULL);
-  gtk_widget_show_all (window);
-}
-
-gint
-main (gint argc, gchar **argv)
-{
-  GtkWidget *dialog, *sw, *tree_view;
-  GtkListStore *model;
-  int i;
-  GtkTreeIter iter;
-  
-  gtk_init (&argc, &argv);
-
-  dialog = gtk_dialog_new_with_buttons ("Egg test",
-					NULL,
-					0,
-					GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
-					NULL);
-  gtk_window_set_default_size (GTK_WINDOW (dialog), 200, 200);
-  g_signal_connect (dialog, "response",
-		    G_CALLBACK (gtk_main_quit), NULL);
-  sw = gtk_scrolled_window_new (NULL, NULL);
-  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN);
-  gtk_container_set_border_width (GTK_CONTAINER (sw), 8);
-  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
-				  GTK_POLICY_AUTOMATIC,
-				  GTK_POLICY_AUTOMATIC);
-  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), sw, TRUE, TRUE, 0);
-
-  model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
-
-  for (i = 0; i < G_N_ELEMENTS (entries); i++)
-    {
-      gtk_list_store_append (model,
-			     &iter);
-      gtk_list_store_set (model,
-			  &iter,
-			  0, entries[i].name,
-			  1, entries[i].create_func,
-			  -1);
-    }
-  
-  tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
-  g_signal_connect (tree_view, "row_activated",
-		    G_CALLBACK (row_activated), NULL);
-  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view), -1,
-					       "Tests", gtk_cell_renderer_text_new (),
-					       "text", 0,
-					       NULL);
-  gtk_container_add (GTK_CONTAINER (sw), tree_view);
-  
-  gtk_widget_show_all (dialog);
-
-  gtk_main ();
-
-  return 0;
-}
Index: libegg/eggtreeviewstate.c
===================================================================
--- libegg/eggtreeviewstate.c	(revision 3787)
+++ libegg/eggtreeviewstate.c	(arbetskopia)
@@ -1,595 +0,0 @@
-#include "eggtreeviewstate.h"
-#include <string.h>
-#include <stdlib.h>
-
-#define _(x) (x)
-
-typedef enum
-{
-  STATE_START,
-  STATE_TREEVIEW_STATE,
-  STATE_TREEVIEW,
-  STATE_COLUMN,
-  STATE_CELL,
-} ParseState;
-
-typedef struct
-{
-  gchar *name;
-  gint column;
-} CellAttribute;
-
-typedef struct
-{
-  GSList *states;
-  GtkTreeView *view;
-
-  GtkTreeViewColumn *column;
-  
-  GtkCellRenderer *cell;
-  gboolean pack_start;
-  gboolean expand;
-  GSList *cell_attributes;
-} ParseInfo;
-
-static void
-set_error (GError             **err,
-           GMarkupParseContext *context,
-           int                  error_domain,
-           int                  error_code,
-           const char          *format,
-           ...)
-{
-  int line, ch;
-  va_list args;
-  char *str;
-  
-  g_markup_parse_context_get_position (context, &line, &ch);
-
-  va_start (args, format);
-  str = g_strdup_vprintf (format, args);
-  va_end (args);
-
-  g_set_error (err, error_domain, error_code,
-               _("Line %d character %d: %s"),
-               line, ch, str);
-
-  g_free (str);
-}
-
-static ParseState
-peek_state (ParseInfo *info)
-{
-  g_return_val_if_fail (info->states != NULL, STATE_START);
-
-  return GPOINTER_TO_INT (info->states->data);
-}
-
-static void
-push_state (ParseInfo  *info,
-            ParseState  state)
-{
-  info->states = g_slist_prepend (info->states, GINT_TO_POINTER (state));
-}
-
-static void
-pop_state (ParseInfo *info)
-{
-  g_return_if_fail (info->states != NULL);
-  
-  info->states = g_slist_remove (info->states, info->states->data);
-}
-
-static void
-parse_info_init (ParseInfo *info)
-{
-  info->states = g_slist_prepend (NULL, GINT_TO_POINTER (STATE_START));
-  info->cell_attributes = NULL;
-  
-}
-
-#define MAX_REASONABLE 4096
-static gboolean
-parse_integer (const char          *str,
-	       GValue              *value,
-	       GMarkupParseContext *context,
-	       GError             **error)
-{
-  char *end;
-  long l;
-
-  end = NULL;
-  
-  l = strtol (str, &end, 10);
-
-  if (end == NULL || end == str)
-    {
-      set_error (error, context, G_MARKUP_ERROR,
-                 G_MARKUP_ERROR_PARSE,
-                 _("Could not parse \"%s\" as an integer"),
-                 str);
-      return FALSE;
-    }
-
-  if (*end != '\0')
-    {
-      set_error (error, context, G_MARKUP_ERROR,
-                 G_MARKUP_ERROR_PARSE,
-                 _("Did not understand trailing characters \"%s\" in string \"%s\""),
-                 end, str);
-      return FALSE;
-    }
-
-  if (l < 0)
-    {
-      set_error (error, context, G_MARKUP_ERROR,
-                 G_MARKUP_ERROR_PARSE,
-                 _("Integer %ld must be positive"), l);
-      return FALSE;
-    }
-
-  if (l > MAX_REASONABLE)
-    {
-      set_error (error, context, G_MARKUP_ERROR,
-                 G_MARKUP_ERROR_PARSE,
-                 _("Integer %ld is too large, current max is %d"),
-                 l, MAX_REASONABLE);
-      return FALSE;
-    }
-
-  g_value_init (value, G_TYPE_INT);
-  g_value_set_int (value, (int)l);
-
-  return TRUE;
-}
-
-static gboolean
-parse_string (const char          *str,
-	      GValue              *value,
-	      GMarkupParseContext *context,
-	      GError             **error)
-{
-  if (!str)
-    return FALSE;
-
-  g_value_init (value, G_TYPE_STRING);
-  g_value_set_string (value, str);
-
-  return TRUE;
-}
-
-static gboolean
-parse_boolean (const char          *str,
-               GValue              *value,
-               GMarkupParseContext *context,
-               GError             **error)
-{
-  if (strcmp ("true", str) == 0)
-    {
-      g_value_init (value, G_TYPE_BOOLEAN);
-      g_value_set_boolean (value, TRUE);
-    }
-  else if (strcmp ("false", str) == 0)
-    {
-      g_value_init (value, G_TYPE_BOOLEAN);
-      g_value_set_boolean (value, FALSE);
-    }
-  else
-    {
-      set_error (error, context, G_MARKUP_ERROR,
-                 G_MARKUP_ERROR_PARSE,
-                 _("Boolean values must be \"true\" or \"false\" not \"%s\""),
-                 str);
-      return FALSE;
-    }
-  
-  return TRUE;
-}
-
-static gboolean
-parse_enum (const gchar          *str,
-	    GValue               *value,
-	    GParamSpecEnum       *pspec,
-	    GMarkupParseContext  *context,
-	    GError              **error)
-{
-  GEnumValue *enum_value;
-
-  enum_value = g_enum_get_value_by_nick (pspec->enum_class, str);
-
-  if (!enum_value)
-    {
-      set_error (error, context, G_MARKUP_ERROR,
-                 G_MARKUP_ERROR_PARSE,
-                 _("The value \"%s\" is not part of the enum \"%s\""),
-                 str,
-		 G_ENUM_CLASS_TYPE_NAME (pspec->enum_class));
-      return FALSE;
-    }
-
-  g_value_init (value, G_ENUM_CLASS_TYPE (pspec->enum_class));
-  g_value_set_enum (value, enum_value->value);
-  
-  return TRUE;
-      
-}
-
-static gboolean
-parse_value (const gchar          *string,
-	     GValue               *value,
-	     GParamSpec           *pspec,
-	     GMarkupParseContext  *context,
-	     GError              **error)
-{
-  if (G_IS_PARAM_SPEC_BOOLEAN (pspec))
-    return parse_boolean (string, value, context, error);
-  else if (G_IS_PARAM_SPEC_INT (pspec))
-    return parse_integer (string, value, context, error);
-  else if (G_IS_PARAM_SPEC_STRING (pspec))
-    return parse_string (string, value, context, error);
-  else if (G_IS_PARAM_SPEC_ENUM (pspec))
-    return parse_enum (string, value, G_PARAM_SPEC_ENUM (pspec), context, error);
-  
-  set_error (error, context, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE,
-	     _("The type \"%s\" can't be parsed from a string"),
-	     g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)));
-  return FALSE;
-}
-
-static gboolean
-parse_object_property (GObject             *object,
-		       const gchar         *attribute_name,
-		       const gchar         *attribute_value,
-		       GMarkupParseContext *context,
-		       GError             **error)
-{
-  GParamSpec *pspec;
-  GValue value = { 0 };
-  
-  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object), attribute_name);
-
-  if (!pspec)
-    {
-      set_error (error, context, G_MARKUP_ERROR,
-		 G_MARKUP_ERROR_PARSE,
-		 _("The property \"%s\" does not exist"),
-		 attribute_name);
-      return FALSE;
-    }
-  
-  if (!parse_value (attribute_value, &value, pspec, context, error))
-    return FALSE;
-  
-  g_object_set_property (object, attribute_name, &value);
-  g_value_unset (&value);
-
-  return TRUE;
-}
-
-static gboolean
-parse_object_properties (GObject             *object,
-			 const gchar        **attribute_names,
-			 const gchar        **attribute_values,
-			 GMarkupParseContext *context,
-			 GError             **error)
-{
-  gint i;
-  
-  for (i = 0; attribute_names[i] != NULL; i++)
-    {
-      if (!parse_object_property (object, attribute_names[i], attribute_values[i], context, error))
-	return FALSE;
-    }
-
-  return TRUE;
-}
-
-static void
-parse_cell_element (GMarkupParseContext *context,
-		    const gchar        **attribute_names,
-		    const gchar        **attribute_values,
-		    ParseInfo           *info,
-		    GError             **error)
-{
-  int i;
-  GtkCellRenderer *cell = NULL;
-
-  info->pack_start = TRUE;
-  info->expand = TRUE;
-  
-  /* We first need to traverse the attributes looking for a type */
-  for (i = 0; attribute_names[i]; i++)
-    {
-      if (strcmp (attribute_names[i], "type") == 0)
-	{
-	  GType type;
-	  
-	  if (cell != NULL)
-	    {
-	      set_error (error, context, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE,
-			 _("The type attribute can only be specified once."));
-	      return;
-	    }
-	  
-	  type = g_type_from_name (attribute_values[i]);
-	  
-	  if (type == G_TYPE_INVALID)
-	    {
-	      set_error (error, context, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE,
-			 _("The type \"%s\" is not a valid type."),
-			 attribute_values[i]);
-	      return;
-	    }
-	  
-	  if (!g_type_is_a (type, GTK_TYPE_CELL_RENDERER))
-	    {
-	      set_error (error, context, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE,
-			 _("The type \"%s\" is not a cell renderer type."),
-			 g_type_name (type));
-	      return;
-	    }
-
-	  cell = g_object_new (type, NULL);
-	}
-    }
-
-  if (!cell)
-    {
-      set_error (error, context, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE,
-		 _("No type attribute specified."));
-      return;
-    }
-  
-  for (i = 0; attribute_names[i]; i++)
-    {
-      if (strcmp (attribute_names[i], "type") == 0)
-	continue;
-      else if (strcmp (attribute_names[i], "pack_start") == 0)
-	{
-	  GValue value = { 0 };
-
-	  if (!parse_boolean (attribute_values[i], &value, context, error))
-	    return;
-
-	  info->pack_start = g_value_get_boolean (&value);
-	}
-      else if (strcmp (attribute_names[i], "expand") == 0)
-	{
-	  GValue value = { 0 };
-
-	  if (!parse_boolean (attribute_values[i], &value, context, error))
-	    return;
-
-	  info->expand = g_value_get_boolean (&value);
-	}
-      else
-	{
-	  if (strstr (attribute_values[i], "model:") == attribute_values[i])
-	    {
-	      CellAttribute *attr;
-	      GValue value = { 0 };
-
-	      if (!parse_integer (attribute_values[i] + strlen ("model:"), &value, context, error))
-		return;
-	      
-	      attr = g_new (CellAttribute, 1);
-	      attr->name = g_strdup (attribute_names[i]);
-	      attr->column = g_value_get_int (&value);
-	      g_value_unset (&value);
-
-	      info->cell_attributes = g_slist_prepend (info->cell_attributes, attr);
-	    }
-	  else
-	    {
-	      if (!parse_object_property (G_OBJECT (cell),
-					  attribute_names[i],
-					  attribute_values[i],
-					  context,
-					  error))
-		return;
-	    }
-	}
-    }
-
-  push_state (info, STATE_CELL);
-  info->cell = cell;
-}
-
-static void
-parse_column_element (GMarkupParseContext *context,
-		      const gchar        **attribute_names,
-		      const gchar        **attribute_values,
-		      ParseInfo           *info,
-		      GError             **error)
-{
-  GtkTreeViewColumn *column;
-
-  column = gtk_tree_view_column_new ();
-
-  if (!parse_object_properties (G_OBJECT (column),
-				attribute_names,
-				attribute_values,
-				context,
-				error))
-    return;
-
-  push_state (info, STATE_COLUMN);
-  
-  info->column = column;
-}
-
-static void
-parse_treeview_element (GMarkupParseContext *context,
-			const gchar        **attribute_names,
-			const gchar        **attribute_values,
-			ParseInfo           *info,
-			GError             **error)
-{
-  if (!parse_object_properties (G_OBJECT (info->view),
-				attribute_names,
-				attribute_values,
-				context,
-				error))
-    return;
-  
-  push_state (info, STATE_TREEVIEW);
-}
-
-static void
-start_element_handler (GMarkupParseContext *context,
-		       const gchar         *element_name,
-		       const gchar        **attribute_names,
-		       const gchar        **attribute_values,
-		       gpointer             user_data,
-		       GError             **error)
-{
-  ParseInfo *info = user_data;
-
-  switch (peek_state (info))
-    {
-    case STATE_START:
-      if (strcmp (element_name, "treeview_state") == 0)
-	{
-	  push_state (info, STATE_TREEVIEW_STATE);
-	}
-      else
-	set_error (error, context, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE,
-                   _("Outermost element in theme must be <treeview_state> not <%s>"),
-                   element_name);
-      break;
-    case STATE_TREEVIEW_STATE:
-      if (strcmp (element_name, "treeview") == 0)
-	{
-	  parse_treeview_element (context, attribute_names, attribute_values, info, error);
-	}
-      else
-	set_error (error, context, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE,
-                   _("Element inside of <treeview_state> must be <treeview> not <%s>"),
-                   element_name);
-      break;
-    case STATE_TREEVIEW:
-      if (strcmp (element_name, "column") == 0)
-	{
-	  parse_column_element (context, attribute_names, attribute_values, info, error);
-	}
-      else
-	set_error (error, context, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE,
-                   _("Element inside of <treeview> must be <column> not <%s>"),
-                   element_name);
-
-      break;
-    case STATE_COLUMN:
-      if (strcmp (element_name, "cell") == 0)
-	{
-	  parse_cell_element (context, attribute_names, attribute_values, info, error);
-	}
-      else
-	set_error (error, context, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE,
-                   _("Element inside of <column> must be <cell> not <%s>"),
-                   element_name);
-
-      break;
-    case STATE_CELL:
-	set_error (error, context, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE,
-                   _("The <cell> element must not have any children."));
-	break;
-    }
-}
-
-static void
-end_element_handler (GMarkupParseContext *context,
-                     const gchar         *element_name,
-                     gpointer             user_data,
-                     GError             **error)
-{
-  ParseInfo *info = user_data;
-  GSList *list;
-  
-  switch (peek_state (info))
-    {
-    case STATE_START:
-      break;
-    case STATE_TREEVIEW_STATE:
-      pop_state (info);
-      g_assert (peek_state (info) == STATE_START);
-      break;
-    case STATE_TREEVIEW:
-      pop_state (info);
-      g_assert (peek_state (info) == STATE_TREEVIEW_STATE);
-      break;
-    case STATE_COLUMN:
-      g_assert (info->column);
-
-      gtk_tree_view_append_column (info->view, info->column);
-      
-      pop_state (info);
-      g_assert (peek_state (info) == STATE_TREEVIEW);
-      break;
-    case STATE_CELL:
-      g_assert (info->cell);
-
-      if (info->pack_start)
-	gtk_tree_view_column_pack_start (info->column, info->cell,
-					 info->expand);
-      else
-	gtk_tree_view_column_pack_end (info->column, info->cell,
-				       info->expand);
-
-      for (list = info->cell_attributes; list; list = list->next)
-	{
-	  CellAttribute *attr = list->data;
-
-	  gtk_tree_view_column_add_attribute (info->column, info->cell,
-					      attr->name,
-					      attr->column);
-	  g_free (attr->name);
-	  g_free (attr);
-	}
-      
-      g_slist_free (info->cell_attributes);
-      info->cell_attributes = NULL;
-      
-      pop_state (info);
-      g_assert (peek_state (info) == STATE_COLUMN);
-    }
-}
-
-
-static GMarkupParser parser =
-{
-  start_element_handler,
-  end_element_handler,
-  NULL,
-  NULL,
-};
-
-gboolean
-egg_tree_view_state_apply_from_string (GtkTreeView *tree_view, const gchar *string, GError **err)
-{
-	GMarkupParseContext *context;
-	GError *error = NULL;
-	gboolean retval;
-	ParseInfo info;
-
-	parse_info_init (&info);
-	info.view = tree_view;
-	
-	context = g_markup_parse_context_new (&parser, 0, &info, NULL);
-
-	retval = g_markup_parse_context_parse (context, string, -1, &error);
-
-	if (!retval)
-	  {
-	    if (err)
-	      *err = error;
-	  }
-	
-	return retval;
-}
-
-void
-egg_tree_view_state_add_cell_renderer_type (GType type)
-{
-  /* Do nothing, this is just to have the types registered */
-}
-
Index: libegg/eggcellrendererkeys.c
===================================================================
--- libegg/eggcellrendererkeys.c	(revision 3787)
+++ libegg/eggcellrendererkeys.c	(arbetskopia)
@@ -1,647 +0,0 @@
-#include <config.h>
-#include <libintl.h>
-#include <gtk/gtk.h>
-#include <gdk/gdkx.h>
-#include <gdk/gdkkeysyms.h>
-#include "eggcellrendererkeys.h"
-#include "eggaccelerators.h"
-
-#ifndef EGG_COMPILATION
-#ifndef _
-#define _(x) dgettext (GETTEXT_PACKAGE, x)
-#define N_(x) x
-#endif
-#else
-#define _(x) x
-#define N_(x) x
-#endif
-
-#define EGG_CELL_RENDERER_TEXT_PATH "egg-cell-renderer-text"
-
-static void             egg_cell_renderer_keys_finalize      (GObject             *object);
-static void             egg_cell_renderer_keys_init          (EggCellRendererKeys *cell_keys);
-static void             egg_cell_renderer_keys_class_init    (EggCellRendererKeysClass *cell_keys_class);
-static GtkCellEditable *egg_cell_renderer_keys_start_editing (GtkCellRenderer          *cell,
-							      GdkEvent                 *event,
-							      GtkWidget                *widget,
-							      const gchar              *path,
-							      GdkRectangle             *background_area,
-							      GdkRectangle             *cell_area,
-							      GtkCellRendererState      flags);
-
-
-static void egg_cell_renderer_keys_get_property (GObject         *object,
-						 guint            param_id,
-						 GValue          *value,
-						 GParamSpec      *pspec);
-static void egg_cell_renderer_keys_set_property (GObject         *object,
-						 guint            param_id,
-						 const GValue    *value,
-						 GParamSpec      *pspec);
-static void egg_cell_renderer_keys_get_size     (GtkCellRenderer *cell,
-						 GtkWidget       *widget,
-						 GdkRectangle    *cell_area,
-						 gint            *x_offset,
-						 gint            *y_offset,
-						 gint            *width,
-						 gint            *height);
-
-
-enum {
-  PROP_0,
-
-  PROP_ACCEL_KEY,
-  PROP_ACCEL_MASK,
-  PROP_ACCEL_MODE
-};
-
-static GtkCellRendererTextClass *parent_class = NULL;
-
-GType
-egg_cell_renderer_keys_get_type (void)
-{
-  static GType cell_keys_type = 0;
-
-  if (!cell_keys_type)
-    {
-      static const GTypeInfo cell_keys_info =
-      {
-        sizeof (EggCellRendererKeysClass),
-	NULL,		/* base_init */
-	NULL,		/* base_finalize */
-        (GClassInitFunc)egg_cell_renderer_keys_class_init,
-	NULL,		/* class_finalize */
-	NULL,		/* class_data */
-        sizeof (EggCellRendererKeys),
-	0,              /* n_preallocs */
-        (GInstanceInitFunc) egg_cell_renderer_keys_init
-      };
-
-      cell_keys_type = g_type_register_static (GTK_TYPE_CELL_RENDERER_TEXT, "EggCellRendererKeys", &cell_keys_info, 0);
-    }
-
-  return cell_keys_type;
-}
-
-static void
-egg_cell_renderer_keys_init (EggCellRendererKeys *cell_keys)
-{
-  cell_keys->accel_mode = EGG_CELL_RENDERER_KEYS_MODE_GTK;
-}
-
-/* FIXME setup stuff to generate this */
-/* VOID:STRING,UINT,FLAGS,UINT */
-static void
-marshal_VOID__STRING_UINT_FLAGS_UINT (GClosure     *closure,
-                                      GValue       *return_value,
-				      guint         n_param_values,
-				      const GValue *param_values,
-				      gpointer      invocation_hint,
-				      gpointer      marshal_data)
-{
-  typedef void (*GMarshalFunc_VOID__STRING_UINT_FLAGS_UINT) (gpointer     data1,
-                                                             const char  *arg_1,
-							     guint        arg_2,
-							     int          arg_3,
-							     guint        arg_4,
-							     gpointer     data2);
-  register GMarshalFunc_VOID__STRING_UINT_FLAGS_UINT callback;
-  register GCClosure *cc = (GCClosure*) closure;
-  register gpointer data1, data2;
-
-  g_return_if_fail (n_param_values == 5);
-
-  if (G_CCLOSURE_SWAP_DATA (closure))
-    {
-      data1 = closure->data;
-      data2 = g_value_peek_pointer (param_values + 0);
-    }
-  else
-    {
-      data1 = g_value_peek_pointer (param_values + 0);
-      data2 = closure->data;
-    }
-  
-  callback = (GMarshalFunc_VOID__STRING_UINT_FLAGS_UINT) (marshal_data ? marshal_data : cc->callback);
-
-  callback (data1,
-            g_value_get_string (param_values + 1),
-            g_value_get_uint (param_values + 2),
-            g_value_get_flags (param_values + 3),
-	    g_value_get_uint (param_values + 4),
-            data2);
-}
-
-static void
-egg_cell_renderer_keys_class_init (EggCellRendererKeysClass *cell_keys_class)
-{
-  GObjectClass *object_class;
-  GtkCellRendererClass *cell_renderer_class;
-
-  object_class = G_OBJECT_CLASS (cell_keys_class);
-  cell_renderer_class = GTK_CELL_RENDERER_CLASS (cell_keys_class);
-  parent_class = g_type_class_peek_parent (object_class);
-  
-  GTK_CELL_RENDERER_CLASS (cell_keys_class)->start_editing = egg_cell_renderer_keys_start_editing;
-
-  object_class->set_property = egg_cell_renderer_keys_set_property;
-  object_class->get_property = egg_cell_renderer_keys_get_property;
-  cell_renderer_class->get_size = egg_cell_renderer_keys_get_size;
-
-  object_class->finalize = egg_cell_renderer_keys_finalize;
-  
-  /* FIXME if this gets moved to a real library, rename the properties
-   * to match whatever the GTK convention is
-   */
-  
-  g_object_class_install_property (object_class,
-                                   PROP_ACCEL_KEY,
-                                   g_param_spec_uint ("accel_key",
-                                                     _("Accelerator key"),
-                                                     _("Accelerator key"),
-                                                      0,
-                                                      G_MAXINT,
-                                                      0,
-                                                      G_PARAM_READABLE | G_PARAM_WRITABLE));
-
-  g_object_class_install_property (object_class,
-                                   PROP_ACCEL_MASK,
-                                   g_param_spec_flags ("accel_mask",
-                                                       _("Accelerator modifiers"),
-                                                       _("Accelerator modifiers"),
-                                                       GDK_TYPE_MODIFIER_TYPE,
-                                                       0,
-                                                       G_PARAM_READABLE | G_PARAM_WRITABLE));
-  
-  /* FIXME: Register the enum when moving to GTK+ */
-  g_object_class_install_property (object_class,
-                                   PROP_ACCEL_MODE,
-                                   g_param_spec_int ("accel_mode",
-						     _("Accelerator Mode"),
-						     _("The type of accelerator."),
-						     0,
-						     2,
-						     0,
-						     G_PARAM_READABLE | G_PARAM_WRITABLE));
-  
-  g_signal_new ("keys_edited",
-                EGG_TYPE_CELL_RENDERER_KEYS,
-                G_SIGNAL_RUN_LAST,
-                G_STRUCT_OFFSET (EggCellRendererKeysClass, keys_edited),
-                NULL, NULL,
-                marshal_VOID__STRING_UINT_FLAGS_UINT,
-                G_TYPE_NONE, 4,
-                G_TYPE_STRING,
-                G_TYPE_UINT,
-                GDK_TYPE_MODIFIER_TYPE,
-		G_TYPE_UINT);
-}
-
-
-GtkCellRenderer *
-egg_cell_renderer_keys_new (void)
-{
-  return GTK_CELL_RENDERER (g_object_new (EGG_TYPE_CELL_RENDERER_KEYS, NULL));
-}
-
-static void
-egg_cell_renderer_keys_finalize (GObject *object)
-{
-  
-  (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-static gchar *
-convert_keysym_state_to_string (guint                  keysym,
-                                EggVirtualModifierType mask)
-{
-  if (keysym == 0)
-    return g_strdup (_("Disabled"));
-  else
-    return egg_virtual_accelerator_name (keysym, mask);
-}
-
-static void
-egg_cell_renderer_keys_get_property  (GObject                  *object,
-                                      guint                     param_id,
-                                      GValue                   *value,
-                                      GParamSpec               *pspec)
-{
-  EggCellRendererKeys *keys;
-
-  g_return_if_fail (EGG_IS_CELL_RENDERER_KEYS (object));
-
-  keys = EGG_CELL_RENDERER_KEYS (object);
-  
-  switch (param_id)
-    {
-    case PROP_ACCEL_KEY:
-      g_value_set_uint (value, keys->accel_key);
-      break;
-
-    case PROP_ACCEL_MASK:
-      g_value_set_flags (value, keys->accel_mask);
-      break;
-
-    case PROP_ACCEL_MODE:
-      g_value_set_int (value, keys->accel_mode);
-      break;
-
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
-    }
-}
-
-static void
-egg_cell_renderer_keys_set_property  (GObject                  *object,
-                                      guint                     param_id,
-                                      const GValue             *value,
-                                      GParamSpec               *pspec)
-{
-  EggCellRendererKeys *keys;
-
-  g_return_if_fail (EGG_IS_CELL_RENDERER_KEYS (object));
-
-  keys = EGG_CELL_RENDERER_KEYS (object);
-  
-  switch (param_id)
-    {
-    case PROP_ACCEL_KEY:
-      egg_cell_renderer_keys_set_accelerator (keys,
-                                              g_value_get_uint (value),
-                                              keys->accel_mask);
-      break;
-
-    case PROP_ACCEL_MASK:
-      egg_cell_renderer_keys_set_accelerator (keys,
-                                              keys->accel_key,
-                                              g_value_get_flags (value));
-      break;
-
-    case PROP_ACCEL_MODE:
-      egg_cell_renderer_keys_set_accel_mode (keys, g_value_get_int (value));
-      break;
-      
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
-    }
-}
-
-static gboolean 
-is_modifier (guint keycode)
-{
-  gint i;
-  gint map_size;
-  XModifierKeymap *mod_keymap;
-  gboolean retval = FALSE;
-
-  mod_keymap = XGetModifierMapping (gdk_display);
-
-  map_size = 8 * mod_keymap->max_keypermod;
-  i = 0;
-  while (i < map_size)
-    {
-      if (keycode == mod_keymap->modifiermap[i])
-        {
-          retval = TRUE;
-          break;
-        }
-      ++i;
-    }
-
-  XFreeModifiermap (mod_keymap);
-
-  return retval;
-}
-
-void
-egg_cell_renderer_keys_get_size (GtkCellRenderer *cell,
-				 GtkWidget       *widget,
-				 GdkRectangle    *cell_area,
-				 gint            *x_offset,
-				 gint            *y_offset,
-				 gint            *width,
-				 gint            *height)
-{
-  EggCellRendererKeys *keys = (EggCellRendererKeys *) cell;
-  GtkRequisition requisition;
-
-  if (keys->sizing_label == NULL)
-    keys->sizing_label = gtk_label_new (_("Type a new accelerator, or press Backspace to clear"));
-
-  gtk_widget_size_request (keys->sizing_label, &requisition);
-  (* GTK_CELL_RENDERER_CLASS (parent_class)->get_size) (cell, widget, cell_area, x_offset, y_offset, width, height);
-  /* FIXME: need to take the cell_area et al. into account */
-  if (width)
-    *width = MAX (*width, requisition.width);
-  if (height)
-    *height = MAX (*height, requisition.height);
-}
-
-/* FIXME: Currently we don't differentiate between a 'bogus' key (like tab in
- * GTK mode) and a removed key.
- */
-   
-static gboolean
-grab_key_callback (GtkWidget    *widget,
-                   GdkEventKey  *event,
-                   void         *data)
-{
-  GdkModifierType accel_mods;
-  guint accel_keyval;
-  EggCellRendererKeys *keys;
-  char *path;
-  gboolean edited;
-  GdkModifierType consumed_modifiers;  
-  guint upper;
-  GdkModifierType ignored_modifiers;
-  
-  keys = EGG_CELL_RENDERER_KEYS (data);
-  accel_mods = 0;
-
-  if (is_modifier (event->hardware_keycode))
-    return TRUE;
-
-  edited = FALSE;
-
-  consumed_modifiers = 0;
-  gdk_keymap_translate_keyboard_state (gdk_keymap_get_default (),
-				       event->hardware_keycode,
-                                       event->state,
-                                       event->group,
-				       NULL, NULL, NULL, &consumed_modifiers);
-
-  upper = event->keyval;
-  accel_keyval = gdk_keyval_to_lower (upper);
-  if (accel_keyval == GDK_ISO_Left_Tab) 
-    accel_keyval = GDK_Tab;
-
-
-  
-  /* Put shift back if it changed the case of the key, not otherwise.
-   */
-  if (upper != accel_keyval &&
-      (consumed_modifiers & GDK_SHIFT_MASK))
-    {
-      consumed_modifiers &= ~(GDK_SHIFT_MASK);
-    }
-
-  egg_keymap_resolve_virtual_modifiers (gdk_keymap_get_default (),
-                                        EGG_VIRTUAL_NUM_LOCK_MASK |
-                                        EGG_VIRTUAL_SCROLL_LOCK_MASK,
-                                        &ignored_modifiers);
-  
-  /* filter consumed/ignored modifiers */
-
-  if (keys->accel_mode == EGG_CELL_RENDERER_KEYS_MODE_GTK)
-    accel_mods = event->state & ~(consumed_modifiers | ignored_modifiers);
-  else if (keys->accel_mode == EGG_CELL_RENDERER_KEYS_MODE_X)
-    accel_mods = event->state & ~(ignored_modifiers);
-  else
-    g_assert_not_reached ();
-    
-  if (accel_mods == 0 && accel_keyval == GDK_Escape)
-    goto out; /* cancel */
-
-  /* clear the accelerator on Backspace */
-  if (keys->edit_key != 0 &&
-      accel_mods == 0 &&
-      accel_keyval == GDK_BackSpace)
-    accel_keyval = 0;
-
-  if (keys->accel_mode == EGG_CELL_RENDERER_KEYS_MODE_GTK)
-    {
-      if (!gtk_accelerator_valid (accel_keyval, accel_mods))
-	{
-	  accel_keyval = 0;
-	  accel_mods = 0;
-	}
-
-      /* Remove modifiers like super and hyper, as GTK+ ignores them. */
-      accel_mods = accel_mods & GDK_MODIFIER_MASK;
-    }
-  
-  edited = TRUE;
- out:
-  path = g_strdup (g_object_get_data (G_OBJECT (keys->edit_widget),
-                                      EGG_CELL_RENDERER_TEXT_PATH));
-  
-  gdk_keyboard_ungrab (event->time);
-  gdk_pointer_ungrab (event->time);
-  
-  gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (keys->edit_widget));
-  gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (keys->edit_widget));
-  keys->edit_widget = NULL;
-  keys->grab_widget = NULL;
-  
-  if (edited)
-    g_signal_emit_by_name (G_OBJECT (keys), "keys_edited", path,
-                           accel_keyval, accel_mods, event->hardware_keycode);
-
-  g_free (path);
-  
-  return TRUE;
-}
-
-static void
-ungrab_stuff (GtkWidget *widget, gpointer data)
-{
-  EggCellRendererKeys *keys = EGG_CELL_RENDERER_KEYS (data);
-
-  gdk_keyboard_ungrab (GDK_CURRENT_TIME);
-  gdk_pointer_ungrab (GDK_CURRENT_TIME);
-
-  g_signal_handlers_disconnect_by_func (G_OBJECT (keys->grab_widget),
-                                        G_CALLBACK (grab_key_callback), data);
-}
-
-static void
-pointless_eventbox_start_editing (GtkCellEditable *cell_editable,
-                                  GdkEvent        *event)
-{
-  /* do nothing, because we are pointless */
-}
-
-static void
-pointless_eventbox_cell_editable_init (GtkCellEditableIface *iface)
-{
-  iface->start_editing = pointless_eventbox_start_editing;
-}
-
-static GType
-pointless_eventbox_subclass_get_type (void)
-{
-  static GType eventbox_type = 0;
-
-  if (!eventbox_type)
-    {
-      static const GTypeInfo eventbox_info =
-      {
-        sizeof (GtkEventBoxClass),
-	NULL,		/* base_init */
-	NULL,		/* base_finalize */
-        NULL,
-	NULL,		/* class_finalize */
-	NULL,		/* class_data */
-        sizeof (GtkEventBox),
-	0,              /* n_preallocs */
-        (GInstanceInitFunc) NULL,
-      };
-
-      static const GInterfaceInfo cell_editable_info = {
-        (GInterfaceInitFunc) pointless_eventbox_cell_editable_init,
-        NULL, NULL };
-
-      eventbox_type = g_type_register_static (GTK_TYPE_EVENT_BOX, "EggCellEditableEventBox", &eventbox_info, 0);
-      
-      g_type_add_interface_static (eventbox_type,
-				   GTK_TYPE_CELL_EDITABLE,
-				   &cell_editable_info);
-    }
-
-  return eventbox_type;
-}
-
-static GtkCellEditable *
-egg_cell_renderer_keys_start_editing (GtkCellRenderer      *cell,
-				      GdkEvent             *event,
-				      GtkWidget            *widget,
-				      const gchar          *path,
-				      GdkRectangle         *background_area,
-				      GdkRectangle         *cell_area,
-				      GtkCellRendererState  flags)
-{
-  GtkCellRendererText *celltext;
-  EggCellRendererKeys *keys;
-  GtkWidget *label;
-  GtkWidget *eventbox;
-  
-  celltext = GTK_CELL_RENDERER_TEXT (cell);
-  keys = EGG_CELL_RENDERER_KEYS (cell);
-  
-  /* If the cell isn't editable we return NULL. */
-  if (celltext->editable == FALSE)
-    return NULL;
-
-  g_return_val_if_fail (widget->window != NULL, NULL);
-  
-  if (gdk_keyboard_grab (widget->window, FALSE,
-                         gdk_event_get_time (event)) != GDK_GRAB_SUCCESS)
-    return NULL;
-
-  if (gdk_pointer_grab (widget->window, FALSE,
-                        GDK_BUTTON_PRESS_MASK,
-                        FALSE, NULL,
-                        gdk_event_get_time (event)) != GDK_GRAB_SUCCESS)
-    {
-      gdk_keyboard_ungrab (gdk_event_get_time (event));
-      return NULL;
-    }
-  
-  keys->grab_widget = widget;
-
-  g_signal_connect (G_OBJECT (widget), "key_press_event",
-                    G_CALLBACK (grab_key_callback),
-                    keys);
-
-  eventbox = g_object_new (pointless_eventbox_subclass_get_type (),
-                           NULL);
-  keys->edit_widget = eventbox;
-  g_object_add_weak_pointer (G_OBJECT (keys->edit_widget),
-                             (void**) &keys->edit_widget);
-  
-  label = gtk_label_new (NULL);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  
-  gtk_widget_modify_bg (eventbox, GTK_STATE_NORMAL,
-                        &widget->style->bg[GTK_STATE_SELECTED]);
-
-  gtk_widget_modify_fg (label, GTK_STATE_NORMAL,
-                        &widget->style->fg[GTK_STATE_SELECTED]);
-  
-  if (keys->accel_key != 0)
-    gtk_label_set_text (GTK_LABEL (label),
-			_("Type a new accelerator, or press Backspace to clear"));
-  else
-    gtk_label_set_text (GTK_LABEL (label),
-                        _("Type a new accelerator"));
-
-  gtk_container_add (GTK_CONTAINER (eventbox), label);
-  
-  g_object_set_data_full (G_OBJECT (keys->edit_widget), EGG_CELL_RENDERER_TEXT_PATH,
-                          g_strdup (path), g_free);
-  
-  gtk_widget_show_all (keys->edit_widget);
-
-  g_signal_connect (G_OBJECT (keys->edit_widget), "unrealize",
-                    G_CALLBACK (ungrab_stuff), keys);
-  
-  keys->edit_key = keys->accel_key;
-  
-  return GTK_CELL_EDITABLE (keys->edit_widget);
-}
-
-void
-egg_cell_renderer_keys_set_accelerator (EggCellRendererKeys *keys,
-                                        guint                keyval,
-                                        EggVirtualModifierType      mask)
-{
-  char *text;
-  gboolean changed;
-  GtkCellRendererText *celltext;
-
-  g_return_if_fail (EGG_IS_CELL_RENDERER_KEYS (keys));
-
-  g_object_freeze_notify (G_OBJECT (keys));
-
-  changed = FALSE;
-  
-  if (keyval != keys->accel_key)
-    {
-      keys->accel_key = keyval;
-      g_object_notify (G_OBJECT (keys), "accel_key");
-      changed = TRUE;
-    }
-
-  if (mask != keys->accel_mask)
-    {
-      keys->accel_mask = mask;
-
-      g_object_notify (G_OBJECT (keys), "accel_mask");
-      changed = TRUE;
-    }  
-  g_object_thaw_notify (G_OBJECT (keys));
-
-  if (changed)
-    {
-      /* sync string to the key values */
-      celltext = GTK_CELL_RENDERER_TEXT (keys);
-      text = convert_keysym_state_to_string (keys->accel_key, keys->accel_mask);
-      g_object_set (keys, "text", text, NULL);
-      g_free (text);
-    }
-  
-}
-
-void
-egg_cell_renderer_keys_get_accelerator (EggCellRendererKeys *keys,
-                                        guint               *keyval,
-                                        EggVirtualModifierType     *mask)
-{
-  g_return_if_fail (EGG_IS_CELL_RENDERER_KEYS (keys));
-
-  if (keyval)
-    *keyval = keys->accel_key;
-
-  if (mask)
-    *mask = keys->accel_mask;
-}
-
-void
-egg_cell_renderer_keys_set_accel_mode (EggCellRendererKeys     *keys,
-				       EggCellRendererKeysMode  accel_mode)
-{
-  g_return_if_fail (EGG_IS_CELL_RENDERER_KEYS (keys));
-  keys->accel_mode = accel_mode;
-  g_object_notify (G_OBJECT (keys), "accel_mode");
-}
Index: libegg/Makefile.am
===================================================================
--- libegg/Makefile.am	(revision 3787)
+++ libegg/Makefile.am	(arbetskopia)
@@ -36,14 +36,11 @@
 	egg-entry-action.c \
 	egg-combo-action.c \
 	egg-recent-action.c \
-	eggaccelerators.c \
-	eggcellrendererkeys.c \
 	eggcellrendererpopup.c \
 	egg-cell-renderer-text.c \
 	eggtreemodelfilter.c \
 	eggtreemodelunion.c \
 	eggtreemultidnd.c \
-	eggtreeviewstate.c \
 	egg-recent-files-module.c \
 	egg-recent-model.c \
 	egg-recent-view-gtk.c \
@@ -61,15 +58,10 @@
 	$(GCONF_LIBS)
 
 noinst_PROGRAMS = \
-	test-tree-utils \
 	test-multi-drag \
 	test-union \
 	test-actions
 
-test_tree_utils_SOURCES = test-tree-utils.c
-test_tree_utils_LDADD = libanjuta-egg.la
-test_tree_utils_DEPENDENCIES = libanjuta-egg.la
-
 test_multi_drag_SOURCES = test-multi-drag.c
 test_multi_drag_LDADD = libanjuta-egg.la
 test_multi_drag_DEPENDENCIES = libanjuta-egg.la
Index: libegg/treeviewutils/eggaccelerators.h
===================================================================
--- libegg/treeviewutils/eggaccelerators.h	(revision 3787)
+++ libegg/treeviewutils/eggaccelerators.h	(arbetskopia)
@@ -1,87 +0,0 @@
-/* eggaccelerators.h
- * Copyright (C) 2002  Red Hat, Inc.
- * Developed by Havoc Pennington
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef __EGG_ACCELERATORS_H__
-#define __EGG_ACCELERATORS_H__
-
-#include <gtk/gtkaccelgroup.h>
-#include <gdk/gdk.h>
-
-G_BEGIN_DECLS
-
-/* Where a value is also in GdkModifierType we coincide,
- * otherwise we don't overlap.
- */
-typedef enum
-{
-  EGG_VIRTUAL_SHIFT_MASK    = 1 << 0,
-  EGG_VIRTUAL_LOCK_MASK	    = 1 << 1,
-  EGG_VIRTUAL_CONTROL_MASK  = 1 << 2,
-
-  EGG_VIRTUAL_ALT_MASK      = 1 << 3, /* fixed as Mod1 */
-  
-  EGG_VIRTUAL_MOD2_MASK	    = 1 << 4,
-  EGG_VIRTUAL_MOD3_MASK	    = 1 << 5,
-  EGG_VIRTUAL_MOD4_MASK	    = 1 << 6,
-  EGG_VIRTUAL_MOD5_MASK	    = 1 << 7,
-
-#if 0
-  GDK_BUTTON1_MASK  = 1 << 8,
-  GDK_BUTTON2_MASK  = 1 << 9,
-  GDK_BUTTON3_MASK  = 1 << 10,
-  GDK_BUTTON4_MASK  = 1 << 11,
-  GDK_BUTTON5_MASK  = 1 << 12,
-  /* 13, 14 are used by Xkb for the keyboard group */
-#endif
-  
-  EGG_VIRTUAL_META_MASK = 1 << 24,
-  EGG_VIRTUAL_SUPER_MASK = 1 << 25,
-  EGG_VIRTUAL_HYPER_MASK = 1 << 26,
-  EGG_VIRTUAL_MODE_SWITCH_MASK = 1 << 27, 
-  EGG_VIRTUAL_NUM_LOCK_MASK = 1 << 28,
-  EGG_VIRTUAL_SCROLL_LOCK_MASK = 1 << 29,
-
-  /* Also in GdkModifierType */
-  EGG_VIRTUAL_RELEASE_MASK  = 1 << 30,
-
-  /*     28-31 24-27 20-23 16-19 12-15 8-11 4-7 0-3
-   *       7     f     0     0     0    0    f   f
-   */  
-  EGG_VIRTUAL_MODIFIER_MASK = 0x7f0000ff
-
-} EggVirtualModifierType;
-
-gboolean egg_accelerator_parse_virtual        (const gchar            *accelerator,
-                                               guint                  *accelerator_key,
-                                               EggVirtualModifierType *accelerator_mods);
-void     egg_keymap_resolve_virtual_modifiers (GdkKeymap              *keymap,
-                                               EggVirtualModifierType  virtual_mods,
-                                               GdkModifierType        *concrete_mods);
-void     egg_keymap_virtualize_modifiers      (GdkKeymap              *keymap,
-                                               GdkModifierType         concrete_mods,
-                                               EggVirtualModifierType *virtual_mods);
-
-gchar* egg_virtual_accelerator_name (guint                  accelerator_key,
-                                     EggVirtualModifierType accelerator_mods);
-
-G_END_DECLS
-
-
-#endif /* __EGG_ACCELERATORS_H__ */
Index: libegg/treeviewutils/eggtreeviewstate.h
===================================================================
--- libegg/treeviewutils/eggtreeviewstate.h	(revision 3787)
+++ libegg/treeviewutils/eggtreeviewstate.h	(arbetskopia)
@@ -1,30 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* eggtreeviewstate.h
- * Copyright (C) 2001 Anders Carlsson, Jonathan Blanford
- *
- * 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, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef __EGG_TREE_VIEW_STATE_H__
-#define __EGG_TREE_VIEW_STATE_H__
-
-#include <gtk/gtktreeview.h>
-
-gboolean egg_tree_view_state_apply_from_string (GtkTreeView *tree_view, const gchar *string, GError **error);
-
-void egg_tree_view_state_add_cell_renderer_type (GType type);
-
-#endif /* __EGG_TREE_VIEW_STATE_H__ */
Index: libegg/treeviewutils/Makefile.am
===================================================================
--- libegg/treeviewutils/Makefile.am	(revision 3787)
+++ libegg/treeviewutils/Makefile.am	(arbetskopia)
@@ -1,11 +1,8 @@
 
 noinst_HEADERS = \
-  eggaccelerators.h	\
-  eggcellrendererkeys.h \
   eggcellrendererpopup.h \
   egg-cell-renderer-text.h \
   eggtreemodelfilter.h \
   eggtreemodelunion.h \
-  eggtreemultidnd.h \
-  eggtreeviewstate.h
+  eggtreemultidnd.h
 
Index: libegg/treeviewutils/eggcellrendererkeys.h
===================================================================
--- libegg/treeviewutils/eggcellrendererkeys.h	(revision 3787)
+++ libegg/treeviewutils/eggcellrendererkeys.h	(arbetskopia)
@@ -1,84 +0,0 @@
-/* gtkcellrendererkeybinding.h
- * Copyright (C) 2000  Red Hat, Inc.,  Jonathan Blandford <jrb@redhat.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef __EGG_CELL_RENDERER_KEYS_H__
-#define __EGG_CELL_RENDERER_KEYS_H__
-
-#include <gtk/gtkcellrenderertext.h>
-#include "eggaccelerators.h"
-
-G_BEGIN_DECLS
-
-#define EGG_TYPE_CELL_RENDERER_KEYS		(egg_cell_renderer_keys_get_type ())
-#define EGG_CELL_RENDERER_KEYS(obj)		(GTK_CHECK_CAST ((obj), EGG_TYPE_CELL_RENDERER_KEYS, EggCellRendererKeys))
-#define EGG_CELL_RENDERER_KEYS_CLASS(klass)	(GTK_CHECK_CLASS_CAST ((klass), EGG_TYPE_CELL_RENDERER_KEYS, EggCellRendererKeysClass))
-#define EGG_IS_CELL_RENDERER_KEYS(obj)		(GTK_CHECK_TYPE ((obj), EGG_TYPE_CELL_RENDERER_KEYS))
-#define EGG_IS_CELL_RENDERER_KEYS_CLASS(klass)	(GTK_CHECK_CLASS_TYPE ((klass), EGG_TYPE_CELL_RENDERER_KEYS))
-#define EGG_CELL_RENDERER_KEYS_GET_CLASS(obj)   (GTK_CHECK_GET_CLASS ((obj), EGG_TYPE_CELL_RENDERER_KEYS, EggCellRendererKeysClass))
-
-typedef struct _EggCellRendererKeys      EggCellRendererKeys;
-typedef struct _EggCellRendererKeysClass EggCellRendererKeysClass;
-
-
-typedef enum
-{
-  EGG_CELL_RENDERER_KEYS_MODE_GTK,
-  EGG_CELL_RENDERER_KEYS_MODE_X,
-} EggCellRendererKeysMode;
-
-struct _EggCellRendererKeys
-{
-  GtkCellRendererText parent;
-  guint accel_key;
-  EggVirtualModifierType accel_mask;
-  GtkWidget *edit_widget;
-  GtkWidget *grab_widget;
-  guint edit_key;
-  GtkWidget *sizing_label;
-  EggCellRendererKeysMode accel_mode;
-};
-
-struct _EggCellRendererKeysClass
-{
-  GtkCellRendererTextClass parent_class;
-
-  void (* keys_edited) (EggCellRendererKeys    *keys,
-                        const char             *path_string,
-                        guint                   keyval,
-                        EggVirtualModifierType  mask,
-			guint                   hardware_keycode);
-};
-
-GType            egg_cell_renderer_keys_get_type        (void);
-GtkCellRenderer *egg_cell_renderer_keys_new             (void);
-
-void             egg_cell_renderer_keys_set_accelerator (EggCellRendererKeys     *keys,
-							 guint                    keyval,
-							 EggVirtualModifierType   mask);
-void             egg_cell_renderer_keys_get_accelerator (EggCellRendererKeys     *keys,
-							 guint                   *keyval,
-							 EggVirtualModifierType  *mask);
-void             egg_cell_renderer_keys_set_accel_mode  (EggCellRendererKeys     *keys,
-							 EggCellRendererKeysMode  accel_mode);
-
-
-G_END_DECLS
-
-
-#endif /* __GTK_CELL_RENDERER_KEYS_H__ */
Index: configure.in
===================================================================
--- configure.in	(revision 3787)
+++ configure.in	(arbetskopia)
@@ -24,7 +24,7 @@
 GMODULE_REQUIRED=2.8.0
 GTHREAD_REQUIRED=2.8.0
 GDK_PIXBUF_REQUIRED=2.0.0
-GTK_REQUIRED=2.8.0
+GTK_REQUIRED=2.10.0
 ORBIT_REQUIRED=2.6.0
 LIBGLADE_REQUIRED=2.3.0
 GNOME_REQUIRED=2.12.0
Index: libanjuta/Makefile.am
===================================================================
--- libanjuta/Makefile.am	(revision 3787)
+++ libanjuta/Makefile.am	(arbetskopia)
@@ -19,7 +19,6 @@
 lib_LTLIBRARIES=libanjuta.la 
 libanjuta_la_LDFLAGS = $(ANJUTA_LDFLAGS) 
 libanjuta_la_LIBADD = \
-	$(top_builddir)/libegg/libanjuta-egg.la \
 	$(top_builddir)/libanjuta/interfaces/libanjuta-interfaces.la \
 	$(GNOME_UI_LIBS) \
 	$(GLADE_LIBS)
Index: libanjuta/anjuta-ui.c
===================================================================
--- libanjuta/anjuta-ui.c	(revision 3787)
+++ libanjuta/anjuta-ui.c	(arbetskopia)
@@ -75,11 +75,10 @@
 #include <gtk/gtkcellrendererpixbuf.h>
 #include <gtk/gtkimage.h>
 #include <gtk/gtklabel.h>
+#include <gtk/gtkcellrendereraccel.h>
 
 #include <libgnome/gnome-macros.h>
 
-#include <libegg/treeviewutils/eggcellrendererkeys.h>
-
 #include "resources.h"
 #include "anjuta-ui.h"
 #include "anjuta-debug.h"
@@ -93,10 +92,10 @@
 
 enum {
 	COLUMN_PIXBUF,
-	COLUMN_ACTION,
+	COLUMN_ACTION_LABEL,
 	COLUMN_VISIBLE,
 	COLUMN_SENSITIVE,
-	COLUMN_DATA,
+	COLUMN_ACTION,
 	COLUMN_GROUP,
 	N_COLUMNS
 };
@@ -116,7 +115,7 @@
 	
 	gtk_tree_model_get (model, &iter,
 						COLUMN_SENSITIVE, &sensitive,
-						COLUMN_DATA, &action, -1);
+						COLUMN_ACTION, &action, -1);
 	g_object_set (G_OBJECT (action), "sensitive", !sensitive, NULL);
 	gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
 						COLUMN_SENSITIVE, !sensitive, -1);
@@ -138,7 +137,7 @@
 	
 	gtk_tree_model_get (model, &iter,
 						COLUMN_VISIBLE, &visible,
-						COLUMN_DATA, &action, -1);
+						COLUMN_ACTION, &action, -1);
 	g_object_set (G_OBJECT (action), "visible", !visible, NULL);
 	gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
 						COLUMN_VISIBLE, !visible, -1);
@@ -169,33 +168,8 @@
 	return action_label;
 }
 
-static gchar*
-get_action_accel_path (GtkAction *action, const gchar *group_name)
-{
-	gchar *accel_path;
-	accel_path = g_strconcat ("<Actions>/", group_name,
-							  "/", gtk_action_get_name (action), NULL);
-	return accel_path;
-}
-
-static gchar*
-get_action_accel (GtkAction *action, const gchar *group_name)
-{
-	gchar *accel_path;
-	gchar *accel_name;
-	GtkAccelKey key;
-	
-	accel_path = get_action_accel_path (action, group_name);
-	if ( gtk_accel_map_lookup_entry (accel_path, &key))
-		accel_name = gtk_accelerator_name (key.accel_key, key.accel_mods);
-	else
-		accel_name = strdup ("");
-	g_free (accel_path);
-	return accel_name;
-}
-
 static void
-accel_edited_callback (GtkCellRendererText *cell,
+accel_edited_callback (GtkCellRendererAccel *cell,
                        const char          *path_string,
                        guint                keyval,
                        GdkModifierType      mask,
@@ -206,26 +180,54 @@
 	GtkTreePath *path = gtk_tree_path_new_from_string (path_string);
 	GtkTreeIter iter;
 	GtkAction *action;
-	gchar *accel_path, *action_group;
+	const gchar *accel_path;
 	
 	gtk_tree_model_get_iter (model, &iter, path);
 	gtk_tree_model_get (model, &iter,
-						COLUMN_DATA, &action,
-						COLUMN_GROUP, &action_group, -1);
+						COLUMN_ACTION, &action, -1);
 	
 	/* sanity check */
-	if (action == NULL || action_group == NULL)
+	if (action == NULL)
 		return;
 	
-	accel_path = get_action_accel_path (action, action_group);
+	accel_path = gtk_action_get_accel_path (action);
 	if (accel_path) {
 		gtk_accel_map_change_entry (accel_path, keyval, mask, TRUE);
-		g_free (accel_path);
 	}
 	
 	gtk_tree_path_free (path);
 }
 
+static void
+accel_cleared_callback (GtkCellRendererAccel *cell,
+						const char *path_string,
+						gpointer data)
+{
+	GtkTreeModel *model = (GtkTreeModel *)data;
+	GtkTreePath *path = gtk_tree_path_new_from_string (path_string);
+	GtkTreeIter iter;
+	GtkAction *action;
+	const gchar *accel_path;
+	
+	
+	gtk_tree_model_get_iter (model, &iter, path);
+	gtk_tree_model_get (model, &iter,
+						COLUMN_ACTION, &action, -1);
+	
+	/* sanity check */
+	if (action == NULL)
+		return;
+	
+	accel_path = gtk_action_get_accel_path (action);
+	if (accel_path) {
+		gtk_accel_map_change_entry (accel_path, 0, 0, TRUE);
+	}
+	
+	gtk_tree_path_free (path);
+}
+	
+	
+
 static gint
 iter_compare_func (GtkTreeModel *model, GtkTreeIter *a,
 				   GtkTreeIter *b, gpointer user_data)
@@ -234,8 +236,8 @@
 	gchar *text_b;
 	gint retval = 0;
 	
-	gtk_tree_model_get (model, a, COLUMN_ACTION, &text_a, -1);
-	gtk_tree_model_get (model, b, COLUMN_ACTION, &text_b, -1);
+	gtk_tree_model_get (model, a, COLUMN_ACTION_LABEL, &text_a, -1);
+	gtk_tree_model_get (model, b, COLUMN_ACTION_LABEL, &text_b, -1);
 	if (text_a == NULL && text_b == NULL) retval = 0;
 	else if (text_a == NULL) retval = -1;
 	else if (text_b == NULL) retval = 1;
@@ -247,42 +249,6 @@
 	return retval;
 }
 
-static gboolean
-binding_from_string (const char      *str,
-                     guint           *accelerator_key,
-                     GdkModifierType *accelerator_mods)
-{
-	EggVirtualModifierType virtual;
-	
-	g_return_val_if_fail (accelerator_key != NULL, FALSE);
-	
-	if (str == NULL || (str && strcmp (str, "disabled") == 0))
-	{
-		*accelerator_key = 0;
-		*accelerator_mods = 0;
-		return TRUE;
-	}
-	
-	if (!egg_accelerator_parse_virtual (str, accelerator_key, &virtual))
-		return FALSE;
-	
-	egg_keymap_resolve_virtual_modifiers (gdk_keymap_get_default (),
-										  virtual,
-										  accelerator_mods);
-	
-	/* Be sure the GTK accelerator system will be able to handle this
-	* accelerator. Be sure to allow no-accelerator accels like F1.
-	*/
-	if ((*accelerator_mods & gtk_accelerator_get_default_mod_mask ()) == 0 &&
-		*accelerator_mods != 0)
-		return FALSE;
-	
-	if (*accelerator_key == 0)
-		return FALSE;
-	else
-		return TRUE;
-}
-
 static void
 accel_set_func (GtkTreeViewColumn *tree_column,
                 GtkCellRenderer   *cell,
@@ -291,30 +257,28 @@
                 gpointer           data)
 {
 	GtkAction *action;
-	gchar *accel_name;
-	gchar *group_name;
-	guint keyval;
-	GdkModifierType keymods;
+	const gchar *accel_path;
+	GtkAccelKey key;
 	
 	gtk_tree_model_get (model, iter,
-						COLUMN_DATA, &action,
-						COLUMN_GROUP, &group_name, -1);
+						COLUMN_ACTION, &action, -1);
 	if (action == NULL)
 		g_object_set (G_OBJECT (cell), "visible", FALSE, NULL);
 	else
 	{
-		accel_name = get_action_accel (action, group_name);
-		if (binding_from_string (accel_name, &keyval, &keymods))
+		if ((accel_path = gtk_action_get_accel_path (action)))
 		{
-			g_object_set (G_OBJECT (cell), "visible", TRUE,
-						  "accel_key", keyval,
-						  "accel_mask", keymods, NULL);
+			if (gtk_accel_map_lookup_entry (accel_path, &key))
+			{
+				g_object_set (G_OBJECT (cell), "visible", TRUE,
+							  "accel-key", key.accel_key,
+							  "accel-mods", key.accel_mods, NULL);
+			}
+			else
+				g_object_set (G_OBJECT (cell), "visible", TRUE,
+							  "accel-key", 0,
+							  "accel-mods", 0, NULL);	
 		}
-		else
-			g_object_set (G_OBJECT (cell), "visible", TRUE,
-						  "accel_key", 0,
-						  "accel_mask", 0, NULL);
-		g_free (accel_name);	
 	}
 }
 
@@ -408,10 +372,10 @@
 								G_TYPE_BOOLEAN,
 								G_TYPE_OBJECT,
 								G_TYPE_STRING);
-	gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE(store), COLUMN_ACTION,
+	gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE(store), COLUMN_ACTION_LABEL,
 									 iter_compare_func, NULL, NULL);
 	gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE(store),
-										  COLUMN_ACTION, GTK_SORT_ASCENDING);
+										  COLUMN_ACTION_LABEL, GTK_SORT_ASCENDING);
 	
 	/* unreferenced in dispose() method. */
 	ui->priv->model = GTK_TREE_MODEL (store);
@@ -574,7 +538,7 @@
 	pixbuf = NULL;
 	gtk_tree_store_set (GTK_TREE_STORE (ui->priv->model), &parent,
 						COLUMN_PIXBUF, pixbuf,
-						COLUMN_ACTION, action_group_label,
+						COLUMN_ACTION_LABEL, action_group_label,
 						COLUMN_GROUP, action_group_name,
 						-1);
 	for (l = actions; l; l = l->next)
@@ -611,10 +575,10 @@
 			{
 				gtk_tree_store_set (GTK_TREE_STORE (ui->priv->model), &iter,
 									COLUMN_PIXBUF, pixbuf,
-									COLUMN_ACTION, action_label,
+									COLUMN_ACTION_LABEL, action_label,
 									COLUMN_VISIBLE, gtk_action_get_visible (action),
 									COLUMN_SENSITIVE, gtk_action_get_sensitive(action),
-									COLUMN_DATA, action,
+									COLUMN_ACTION, action,
 									COLUMN_GROUP, action_group_name,
 									-1);
 				g_object_unref (G_OBJECT (pixbuf));
@@ -625,10 +589,10 @@
 		else
 		{
 			gtk_tree_store_set (GTK_TREE_STORE (ui->priv->model), &iter,
-								COLUMN_ACTION, action_label,
+								COLUMN_ACTION_LABEL, action_label,
 								COLUMN_VISIBLE, gtk_action_get_visible (action),
 								COLUMN_SENSITIVE, gtk_action_get_sensitive (action),
-								COLUMN_DATA, action,
+								COLUMN_ACTION, action,
 								COLUMN_GROUP, action_group_name,
 								-1);
 		}
@@ -898,7 +862,7 @@
 	renderer = gtk_cell_renderer_text_new ();
 	gtk_tree_view_column_pack_start (column, renderer, TRUE);
 	gtk_tree_view_column_add_attribute (column, renderer, "text",
-										COLUMN_ACTION);
+										COLUMN_ACTION_LABEL);
 	gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
 	gtk_tree_view_set_expander_column (GTK_TREE_VIEW (tree_view), column);
 	gtk_tree_view_column_set_sort_column_id (column, 0);
@@ -928,17 +892,19 @@
 	column = gtk_tree_view_column_new ();
 	gtk_tree_view_column_set_title (column, _("Shortcut"));
 	/* gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);	*/
-	renderer = g_object_new (EGG_TYPE_CELL_RENDERER_KEYS,
+	renderer = g_object_new (GTK_TYPE_CELL_RENDERER_ACCEL,
 							"editable", TRUE,
-							"accel_mode", EGG_CELL_RENDERER_KEYS_MODE_GTK,
 							NULL);
-	g_signal_connect (G_OBJECT (renderer), "keys_edited",
+	g_signal_connect (G_OBJECT (renderer), "accel-edited",
 					  G_CALLBACK (accel_edited_callback),
 					  store);
+	g_signal_connect (G_OBJECT (renderer), "accel-cleared",
+					  G_CALLBACK (accel_cleared_callback),
+					  store);
 	g_object_set (G_OBJECT (renderer), "editable", TRUE, NULL);
 	gtk_tree_view_column_pack_start (column, renderer, TRUE);
 	gtk_tree_view_column_set_cell_data_func (column, renderer, accel_set_func, NULL, NULL);
-	gtk_tree_view_column_set_sort_column_id (column, COLUMN_DATA);
+	gtk_tree_view_column_set_sort_column_id (column, COLUMN_ACTION);
 	gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
 	
 	sw = gtk_scrolled_window_new (NULL, NULL);
