/* Used for the matched word. */
EB_Error_Code hook_set_begin_decoration(EB_Book *book, EB_Appendix *appendix, void *container,
  EB_Hook_Code code, int argc, const unsigned int *argv)
{
  /* argv means italic or bold info */
  eb_write_text_string(book, "<begin_decoration>");
  return 0;
}
示例#2
0
文件: qeb.cpp 项目: fujii/qolibri
EB_Error_Code QEb::writeTextString(const QString &s)
{
    EB_Error_Code ecode = eb_write_text_string(&book, utfToEuc(s));
    if (ecode != EB_SUCCESS)
        dispError("eb_write_text_string", ecode);
    return ecode;
}
/* End link/reference */
EB_Error_Code hook_set_end_reference(EB_Book *book, EB_Appendix *appendix, void *container,
  EB_Hook_Code code, int argc, const unsigned int *argv)
{
  char link_text[100] = "";
  EB_Position position;

  position.page = argv[1];
  position.offset = argv[2];

  sprintf(link_text, "</LINK[%X:%X]>", position.page, position.offset);

  eb_write_text_string(book, link_text);
  return 0;
}
/* Gaiji - Wide */
EB_Error_Code hook_set_wide_font(EB_Book *book, EB_Appendix *appendix, void *container,
  EB_Hook_Code code, int argc, const unsigned int *argv)
{
  char replacement[MAXLEN_PATH] = "";

  /* Check if there is a UTF-8 replacement for this gaiji code */
  if(get_gaiji_replacment_elem(subbook_directory, 'w', (unsigned short)argv[0]) != NULL)
  {
    sprintf(replacement, "{#w%04X}", argv[0]);
  }
  else if(gaiji_option == GAIJI_OPTION_HTML_IMG) /* Add HTML IMG tag */
  {    
    get_character_html_img(replacement, book, SAVE_BMP, SAVE_WIDE, argv[0]);
  }
  else
  {
    sprintf(replacement, "?");
  }
  
  eb_write_text_string(book, replacement);

  return 0;
}
EB_Error_Code hook_set_begin_in_color_jpeg(EB_Book *book, EB_Appendix *appendix, void *container,
  EB_Hook_Code code, int argc, const unsigned int *argv)
{
  eb_write_text_string(book, "<egin_in_color_jpeg>");
  return 0;
}
/* Used for the normal japanese text */
EB_Error_Code hook_set_wide_jisx0208(EB_Book *book, EB_Appendix *appendix, void *container,
  EB_Hook_Code code, int argc, const unsigned int *argv)
{
  eb_write_text_string(book, "<ide_jisx0208>");
  return 0;
}
/* End superscript */
EB_Error_Code hook_set_end_superscript(EB_Book *book, EB_Appendix *appendix, void *container,
  EB_Hook_Code code, int argc, const unsigned int *argv)
{
  eb_write_text_string(book, "</sup>");
  return 0;
}
EB_Error_Code hook_set_end_mono_graphic(EB_Book *book, EB_Appendix *appendix, void *container,
  EB_Hook_Code code, int argc, const unsigned int *argv)
{
  eb_write_text_string(book, "<end_mono_graphic>");
  return 0;
}
/* The end of the keyword */
EB_Error_Code hook_set_end_keyword(EB_Book *book, EB_Appendix *appendix, void *container,
  EB_Hook_Code code, int argc, const unsigned int *argv)
{
  eb_write_text_string(book, "</KEYWORD>");
  return 0;
}