initial import for sdlhaa & sdlhim
[sdlhildon] / sdlhim / src / atoms.h
diff --git a/sdlhim/src/atoms.h b/sdlhim/src/atoms.h
new file mode 100644 (file)
index 0000000..374f73c
--- /dev/null
@@ -0,0 +1,41 @@
+/* This file is part of SDL_him - SDL Hildon Input Method addon
+ * Copyright (C) 2010 Javier S. Pedro
+ *
+ * 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 3 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA or see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef ATOMS_H
+#define ATOMS_H
+
+/* Important needed definition: HILDON_IM_NUM_ATOMS */
+#include <hildon-im-protocol.h>
+
+/* The atoms we need were changed in Fremantle */
+#if MAEMO_VERSION == 5
+#define ATOMS_INC_FILE "atoms-fremantle.inc"
+#elif MAEMO_VERSION == 4
+#define ATOMS_INC_FILE "atoms-diablo.inc"
+#else
+#error No atom definitions
+#endif
+
+extern const char * atom_names[HILDON_IM_NUM_ATOMS];
+extern Atom atom_values[HILDON_IM_NUM_ATOMS];
+
+#define ATOM(X) atom_values[ X ]
+
+#endif
+