~ubuntu-branches/ubuntu/oneiric/denemo/oneiric

« back to all changes in this revision

Viewing changes to src/kbd-custom.c

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2010-10-27 08:00:18 UTC
  • mfrom: (1.2.7 upstream) (3.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20101027080018-suwj9ozy99d0a5a2
Tags: 0.8.16-1ubuntu1
* Merge with Debian testing (LP: #638617), Ubuntu remaining changes:
  - debian/patches/ubuntuize.diff:
    + Provide a Ubuntu-specific customization.
  - debian/patches/fix_desktop.diff:
    + Add missing trailing semicolon.
    + Add MIME types.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#define  GDK_META_MASK   (1 << 28)
37
37
#endif
38
38
 
 
39
 
 
40
#ifdef G_OS_WIN32
 
41
#define DEFAULT_KEYMAP "Windows.cmdset"
 
42
#else
39
43
#define DEFAULT_KEYMAP "Default.cmdset"
 
44
#endif
 
45
 
40
46
//index of columns in the keymap command list store FIXME if you add columns you must add them in keymap_get_command_row and allocate_keymap !!!!
41
47
enum {
42
48
    COL_TYPE = 0,
734
740
    g_string_append_printf(str, "%s%s", name, separator);
735
741
}
736
742
 
 
743
#if 0
737
744
static void
738
745
newlinename(gchar *name, GString *str) {
739
746
 catname(name, str, "\n");
740
747
}
 
748
#endif
 
749
 
741
750
static void
742
751
listname(gchar *name, GString *str) {
743
752
  catname(name, str, " ");
956
965
 
957
966
//returns the accel, "" if no accel defined. free the result
958
967
//the accel is the first keybinding of the list
 
968
#if 0
959
969
static gchar *
960
970
keymap_get_accel(keymap *the_keymap, guint command_idx)
961
971
{
975
985
  g_object_unref(row.bindings);
976
986
  return res;
977
987
}
 
988
#endif
978
989
 
 
990
#if 0
979
991
static gint
980
992
findActionGroupByName(gconstpointer a, gconstpointer b)
981
993
{
983
995
    const gchar * searched_name = (const gchar *) b;
984
996
    return strcmp(gtk_action_group_get_name(action_group), b);
985
997
}
 
998
#endif
986
999
 
987
1000
 
988
1001
 
1275
1288
  if (!keymap_get_command_row(the_keymap, &row, command_idx))
1276
1289
      return FALSE;
1277
1290
  g_object_unref(row.bindings);
1278
 
  res = (gboolean)row.callback;
 
1291
  res = (gboolean)(intptr_t)row.callback;
1279
1292
  return res;
1280
1293
}
1281
1294
 
1385
1398
  Denemo.accelerator_status = TRUE;
1386
1399
}
1387
1400
 
1388
 
 
 
1401
#if 0
1389
1402
static  void show_type(GtkWidget *widget, gchar *message) {
1390
1403
    g_print("%s%s\n",message, widget?g_type_name(G_TYPE_FROM_INSTANCE(widget)):"NULL widget");
1391
1404
  }
 
1405
#endif
 
1406
 
1392
1407
/**
1393
1408
 * Function for loading a command set (aka keymap) from location by way of
1394
1409
 * a user dialog. 
1661
1676
            COL_TYPE, &type,
1662
1677
            COL_ACTION, &action,
1663
1678
            -1);
1664
 
    hidden = (gboolean)g_object_get_data(G_OBJECT(action), "hidden");   
 
1679
    hidden = g_object_get_data(G_OBJECT(action), "hidden") ? TRUE : FALSE;   
1665
1680
    g_object_set(renderer, "active", hidden, NULL);
1666
1681
}
1667
1682
 
1679
1694
            COL_TYPE, &type,
1680
1695
            COL_ACTION, &action,
1681
1696
            -1);
1682
 
    deleted = (gboolean)g_object_get_data(G_OBJECT(action), "deleted");   
 
1697
    deleted = g_object_get_data(G_OBJECT(action), "deleted") ? TRUE : FALSE;   
1683
1698
    g_object_set(renderer, "active", deleted, NULL);
1684
1699
}
1685
1700
 
1710
1725
  gint command_idx = atoi(path);
1711
1726
  GtkAction *action = (GtkAction *)lookup_action_from_idx (Denemo.map, command_idx);
1712
1727
  if(GTK_IS_ACTION(action)){
1713
 
    gboolean hidden = (gboolean)g_object_get_data(G_OBJECT(action), "hidden");
 
1728
    gboolean hidden = ( g_object_get_data(G_OBJECT(action), "hidden") != NULL);
1714
1729
    set_visibility_for_action(action, hidden);
1715
1730
  }
1716
1731
}
1721
1736
  gint command_idx = atoi(path);
1722
1737
  GtkAction *action = (GtkAction *)lookup_action_from_idx (Denemo.map, command_idx);
1723
1738
  if(GTK_IS_ACTION(action)){
1724
 
    gboolean deleted = (gboolean)g_object_get_data(G_OBJECT(action), "deleted");
 
1739
    gboolean deleted = (g_object_get_data(G_OBJECT(action), "deleted") != NULL);
1725
1740
    //set_visibility_for_action(action, deleted);
1726
 
    g_object_set_data(G_OBJECT(action), "deleted", (gboolean *)!deleted);
 
1741
    g_object_set_data(G_OBJECT(action), "deleted", (gboolean *)(intptr_t) !deleted);
1727
1742
  }
1728
1743
}
1729
1744