bool CUIChat::Load(HANDLE hFile) { if (false == CN3UIBase::Load(hFile)) return false; m_pChatOut = (CN3UIString*)GetChildByID("text0"); __ASSERT(m_pChatOut, "NULL UI Component!!"); m_pScrollbar = (CN3UIScrollBar*)GetChildByID("scroll"); __ASSERT(m_pScrollbar, "NULL UI Component!!"); m_pNoticeTitle = (CN3UIString*)GetChildByID("text_notice_title"); __ASSERT(m_pNoticeTitle, "NULL UI Component!!"); m_rcChatOutRegion = m_pChatOut->GetRegion(); CreateLines(); __ASSERT(0<m_iChatLineCount,"채팅창이 너무 작아요"); //son, chat_in m_pEdit = (CN3UIEdit*)GetChildByID("edit0"); __ASSERT(m_pEdit, "NULL UI Component!!"); m_pEdit->SetMaxString(256); // 채팅 문자열 길이 제한.. //son, chat_in m_pBtn_Normal = GetChildByID("btn_normal"); __ASSERT(m_pBtn_Normal, "NULL UI Component!!"); m_pBtn_Private = GetChildByID("btn_private"); __ASSERT(m_pBtn_Private, "NULL UI Component!!"); m_pBtn_PartyOrForce = GetChildByID("btn_party_force"); __ASSERT(m_pBtn_PartyOrForce, "NULL UI Component!!"); //m_pBtn_KnightsOrGuild = GetChildByID("btn_knights_guild"); __ASSERT(m_pBtn_KnightsOrGuild, "NULL UI Component!!"); m_pBtn_KnightsOrGuild = GetChildByID("btn_clan"); __ASSERT(m_pBtn_KnightsOrGuild, "NULL UI Component!!"); m_pBtn_Shout = GetChildByID("btn_shout"); __ASSERT(m_pBtn_Shout, "NULL UI Component!!"); m_pBtn_Check = GetChildByID("btn_check_normal"); __ASSERT(m_pBtn_Check, "NULL UI Component!!"); this->ChangeChattingMode(N3_CHAT_NORMAL); // 보통 채팅 모드이다.. return true; }
static void MendDocument(Document *doc) { size_t nchars; Character **chars = ExtractCharacters(doc, &nchars); for (int i = 0; i < nchars; i++) ResetCharacterWidth(chars[i]); size_t ntokens; Token *tokens = ExtractTokens(doc, &ntokens); for (int i = 0; i < ntokens; i++) MendToken(&tokens[i]); doc->lines = CreateLines(tokens, ntokens, doc->page, &doc->nlines); }
Document *CreateDocument(const char *text, const PageInfo *page) { Document *doc = GC_MALLOC(sizeof(Document)); size_t nchars; Character *chars = StringToCharacters(text, strlen(text), &nchars); // TODO: ファイルの長さで作る size_t ntokens; Token *tokens = CharactersToTokens(chars, nchars, &ntokens); doc->lines = CreateLines(tokens, ntokens, page, &doc->nlines); doc->page = GC_MALLOC(sizeof(PageInfo)); *doc->page = *page; return doc; }