---
title: Hardcoded GNOMEish composition
author: james
type: post
date: 2012-06-11T16:42:20+00:00
url: /2012/06/hardcoded-gnomeish-composition/
categories:
  - Tech

---
From Ubuntu docs about the Compose key at https://help.ubuntu.com/community/ComposeKey:

> The compose key sequences used by Gnome are derived from the X compose tables of XFree86 version 4.0 with further modifications to provide a Gnome standard for all locales. They are hard coded into the program in source file gtk+-2.10.7/gtk/gtkimcontextsimple.c

Digging into the current Debian gtk+ source verifies this:
  
`<br />
/* This file contains the table of the compose sequences,<br />
 * static const guint16 gtk_compose_seqs_compact[] = {}<br />
 * IT is generated from the compose-parse.py script.<br />
 */<br />
#include "gtkimcontextsimpleseqs.h"<br />
` 

So they start with the X Input Method layer which has nice unixy text config files (check out /usr/share/X11/locale) and they want to extend it with some extra sequences. What&#8217;s the best way to do that? Clearly snarf what&#8217;s already there, bolt on your own bits and hardcode the lot into your binary.

Well done, chaps.
