#include <dlfcn.h>
#endif
-#include "m17n-gui.h"
+#include "m17n.h"
#include "m17n-misc.h"
#include "internal.h"
#include "mtext.h"
#include "database.h"
#include "charset.h"
-static int mdebug_mask = MDEBUG_INPUT;
+static int mdebug_flag = MDEBUG_INPUT;
static int fully_initialized;
state = (MIMState *) MPLIST_VAL (im_info->states);
}
- if (mdebug__flag & mdebug_mask)
+ if (MDEBUG_FLAG ())
{
if (orig_state)
MDEBUG_PRINT2 ("\n [IM] [%s] (shift %s)\n",
int nchars = mt ? mtext_nchars (mt) : 1;
if (mt)
- mtext_ins (ic->preedit, pos, mt);
+ {
+ mtext_ins (ic->preedit, pos, mt);
+ MDEBUG_PRINT1 ("(\"%s\")", MTEXT_DATA (mt));
+ }
else
- mtext_ins_char (ic->preedit, pos, c, 1);
+ {
+ mtext_ins_char (ic->preedit, pos, c, 1);
+ MDEBUG_PRINT1 ("('%c')", c);
+ }
adjust_markers (ic, pos, pos, nchars);
ic->preedit_changed = 1;
}
mtext_put_prop_values (ic->preedit, 0, mtext_nchars (ic->preedit),
Mcandidate_index, NULL, 0);
mtext_cat (ic->produced, ic->preedit);
- if (mdebug__flag & mdebug_mask)
+ if (MDEBUG_FLAG ())
{
int i;
int ingroup_index = idx - start;
MText *mt;
+ candidate_list = mplist_copy (candidate_list);
if (MPLIST_MTEXT_P (group))
{
mt = MPLIST_MTEXT (group);
preedit_replace (ic, from, to, mt, 0);
to = from + mtext_nchars (mt);
}
- candidate_list = mplist_copy (candidate_list);
mtext_put_prop (ic->preedit, from, to, Mcandidate_list, candidate_list);
M17N_OBJECT_UNREF (candidate_list);
mtext_put_prop (ic->preedit, from, to, Mcandidate_index, (void *) idx);
fini_ic_info (ic);
if (reload)
reload_im_info (im_info);
+ if (! im_info->states)
+ {
+ struct MIMState *state;
+
+ M17N_OBJECT (state, free_state, MERROR_IM);
+ state->name = msymbol ("init");
+ state->title = mtext__from_data ("ERROR!", 6, MTEXT_FORMAT_US_ASCII, 0);
+ MSTRUCT_CALLOC (state->map, MERROR_IM);
+ im_info->states = mplist ();
+ mplist_add (im_info->states, state->name, state);
+ }
init_ic_info (ic);
shift_state (ic, Mnil);
+
ic->status_changed = status_changed;
ic->preedit_changed = preedit_changed;
ic->cursor_pos_changed = cursor_pos_changed;
{
MInputMethodInfo *im_info = get_im_info (im->language, im->name, Mnil, Mnil);
- if (! im_info)
+ if (! im_info || ! im_info->states)
MERROR (MERROR_IM, -1);
im->info = im_info;
if (mtext_nchars (ic->produced) > 0)
{
- if (mdebug__flag & mdebug_mask)
+ if (MDEBUG_FLAG ())
{
MDEBUG_PRINT1 ("\n [IM] [%s] (produced",
MSYMBOL_NAME (ic_info->state->name));
If $COMMAND is #Mnil, information about all commands is returned.
- The return value is a @e well-formed plist (#m17nPlist) of this
+ The return value is a @e well-formed plist (@ref m17nPlist) of this
format:
@verbatim
((NAME DESCRIPTION STATUS [KEYSEQ ...]) ...)
$COMMAND ¤¬ #Mnil ¤Î¾ì¹ç¤Ï¡¢¤¹¤Ù¤Æ¤Î¥³¥Þ¥ó¥É¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÖ¤¹¡£
- Ìá¤êÃͤϰʲ¼¤Î·Á¼°¤Î @e well-formed plist (#m17nPlist) ¤Ç¤¢¤ë¡£
+ Ìá¤êÃͤϰʲ¼¤Î·Á¼°¤Î @e well-formed plist (@ref m17nPlist) ¤Ç¤¢¤ë¡£
@verbatim
((NAME DESCRIPTION STATUS [KEYSEQ ...]) ...)
If $VARIABLE is #Mnil, information about all variables is
returned.
- The return value is a @e well-formed plist (#m17nPlist) of this
+ The return value is a @e well-formed plist (@ref m17nPlist) of this
format:
@verbatim
((NAME DESCRIPTION STATUS VALUE [VALID-VALUE ...]) ...)
$VARIABLE ¤¬ #Mnil ¤Î¾ì¹ç¤Ï¡¢¤¹¤Ù¤Æ¤Î¥³¥Þ¥ó¥É¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÖ¤¹¡£
- Ìá¤êÃͤϰʲ¼¤Î·Á¼°¤Î @e well-formed plist (#m17nPlist) ¤Ç¤¢¤ë¡£
+ Ìá¤êÃͤϰʲ¼¤Î·Á¼°¤Î @e well-formed plist (@ref m17nPlist) ¤Ç¤¢¤ë¡£
@verbatim
((NAME DESCRIPTION STATUS VALUE [VALID-VALUE ...]) ...)
@endverbatim
The minput_get_variables () function returns a plist (#MPlist) of
variables used to control the behavior of the input method
specified by $LANGUAGE and $NAME. The plist is @e well-formed
- (#m17nPlist) of the following format:
+ (@ref m17nPlist) of the following format:
@verbatim
(VARNAME (DOC-MTEXT DEFAULT-VALUE [ VALUE ... ] )
´Ø¿ô minput_get_variables () ¤Ï¡¢$LANGUAGE ¤È $NAME ¤Ë¤è¤Ã¤Æ»ØÄꤵ
¤ì¤¿ÆþÎϥ᥽¥Ã¥É¤Î¿¶¤ëÉñ¤¤¤òÀ©¸æ¤¹¤ëÊÑ¿ô¤Î¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È
- (#MPlist) ¤òÊÖ¤¹¡£¤³¤Î¥ê¥¹¥È¤Ï @e well-formed ¤Ç¤¢¤ê(#m17nPlist) °Ê
+ (#MPlist) ¤òÊÖ¤¹¡£¤³¤Î¥ê¥¹¥È¤Ï @e well-formed ¤Ç¤¢¤ê(@ref m17nPlist) °Ê
²¼¤Î·Á¼°¤Ç¤¢¤ë¡£
@verbatim