Esempio n. 1
0
void
hz_input_init1 (void)
{
  int i, len;
  char fn[128];

  IsHanziInput = 0;		// default is ascii input
  IsFullChar = 0;
  gsCurrent_method = 1;
  gsInput_table_array[0] = IntCode_Init ();

  for (i = 1; i < 10; i++)
    if (tabfname[i] != NULL) {
      //fn[strlen(fn) - 1] = '0' + i;
      len = strlen (tabfname[i]);
      strcpy (fn, "/usr/lib/jmcce/");
      strcat (fn, tabfname[i]);
      if (len < 4 || strcmp (tabfname[i] + len - 4, ".tab") != 0)
	strcat (fn, ".tab");

      printf ("Input Method %d: %s\n", i, fn);
      if (access (fn, R_OK) == 0)
	gsInput_table_array[i] = load_input_method (fn);
      else
	gsInput_table_array[i] = NULL;
    }
}
Esempio n. 2
0
BOOL ime_pinyin_init (void)
{
	CurIME          = 1;
	input_table[0]  = IntCode_Init();
	input_table [1] = load_input_method();
	cur_table       = input_table [1];
	return TRUE;
}
Esempio n. 3
0
void hz_input_init (void)
{
  int i, len;
  char fn[128];

  IsHanziInput = 0;		// default is ascii input
  IsFullChar = 0;
  gsCurrent_method = 1;

  std::string jmcce_conf_path(jmcce_path);

  if (gDontLoadInputMethod != 1) {

    if (gEncode == BIG5) {
      INIfile_load((std::string(jmcce_conf_path + "/../conf/jmcceb5.ini")).c_str());
    }
    #if 0
    if (gEncode == GB) {
      INIfile_load (JMCCE_CONFDIR"/jmccegb.ini");
    }
    #endif

    sprintf (fn, "%s/%s", home_dir, JMCCE_LOG);

    if ((gMessage_log_file = fopen (fn, "w+")) == NULL) {
      fprintf (stderr, "Warning: can't open log file\n");
      return;
    }

    for (i = 0; i <= gItem_count; i++)
      gsInput_table_array[i] = NULL;

    gsInput_table_array[0] = IntCode_Init ();

    for (i = 1; i <= gItem_count; i++) {
      gsInput_table_array[i] = NEW_InputTable_load (i);
    }
    //exit(0);

#ifdef NEW_CHEWING
    //gsInput_table_array[7] = Chew_Init ();	/* Chewing */
    new_chew_init();
#endif
    fclose (gMessage_log_file);


  }



}