/* m17n-X.c -- implementation of the GUI API on X Windows.
- Copyright (C) 2003, 2004
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H15PRO112
int alt_mask;
int super_mask;
int hyper_mask;
+ int altgr_mask;
Atom MULE_BASELINE_OFFSET;
Atom AVERAGE_WIDTH;
KeyCode super_r = XKeysymToKeycode (display, XK_Super_R);
KeyCode hyper_l = XKeysymToKeycode (display, XK_Hyper_L);
KeyCode hyper_r = XKeysymToKeycode (display, XK_Hyper_R);
+#ifdef XK_XKB_KEYS
+ KeyCode altgr = XKeysymToKeycode (display, XK_ISO_Level3_Shift);
+#endif
int i, j;
mods = XGetModifierMapping (display);
disp_info->super_mask |= (1 << i);
else if (code == hyper_l || code == hyper_r)
disp_info->hyper_mask |= (1 << i);
+#ifdef XK_XKB_KEYS
+ else if (code == altgr)
+ disp_info->altgr_mask |= (1 << i);
+#endif
}
/* If meta keys are not in any modifier, use alt keys as meta
MFLTGlyphString *in, int from, int to,
MFLTGlyphString *out,
MFLTGlyphAdjustment *adjustment);
+static int xft_try_otf (MFLTFont *font, MFLTOtfSpec *spec,
+ MFLTGlyphString *in, int from, int to);
static int xft_iterate_otf_feature (struct _MFLTFont *font, MFLTOtfSpec *spec,
int from, int to, unsigned char *table);
static MFontDriver xft_driver =
{ NULL, xft_open,
xft_find_metric, xft_has_char, xft_encode_char, xft_render, NULL, NULL,
- xft_check_capability, NULL, NULL, xft_check_otf, xft_drive_otf,
+ xft_check_capability, NULL, NULL, xft_check_otf, xft_drive_otf, xft_try_otf,
#ifdef HAVE_OTF
xft_iterate_otf_feature
#endif /* HAVE_OTF */
return result;
}
+static int
+xft_try_otf (MFLTFont *font, MFLTOtfSpec *spec,
+ MFLTGlyphString *in, int from, int to)
+{
+ return xft_drive_otf (font, spec, in, from, to, NULL, NULL);
+}
+
#ifdef HAVE_OTF
static int
return Mnil;
if (keysym >= XK_Shift_L && keysym <= XK_Hyper_R)
return Mnil;
+#ifdef XK_XKB_KEYS
+ if ((keysym & 0xff00) == 0xfe00)
+ return Mnil;
+#endif
if (len == 1 && keysym >= XK_space && keysym <= XK_asciitilde)
{
int c = keysym;
*modifiers |= MINPUT_KEY_SUPER_MODIFIER;
if (((XKeyEvent *) event)->state & disp_info->hyper_mask)
*modifiers |= MINPUT_KEY_HYPER_MODIFIER;
-
+#ifdef XK_XKB_KEYS
+ if (((XKeyEvent *) event)->state & disp_info->altgr_mask)
+ *modifiers |= MINPUT_KEY_ALTGR_MODIFIER;
+#endif
return key;
}