Logo Search packages:      
Sourcecode: fcitx-sunpinyin version File versions  Download package

void FcitxWindowHandler::updatePreedit ( const IPreeditString *  ppd ) [virtual]

handler called while preedit updated

Parameters:
ppdpreedit string
Returns:
void

Definition at line 26 of file handler.cpp.

{
    char *buf_ = eim->CodeInput;
    TIConvSrcPtr src = (TIConvSrcPtr) (ppd->string());
    memset(front_src, 0, BUF_SIZE * sizeof(TWCHAR));
    memset(end_src, 0, BUF_SIZE * sizeof(TWCHAR));
    
    memcpy(front_src, src, ppd->caret() * sizeof(TWCHAR));
    memcpy(end_src, src + ppd->caret() * sizeof(TWCHAR), 
           (ppd->size() - ppd->caret() + 1) * sizeof(TWCHAR));
    
    memset(buf_, 0, MAX_USER_INPUT + 1);
    
    WCSTOMBS(buf_, front_src, MAX_USER_INPUT);
    eim->CaretPos = strlen(buf_);
    WCSTOMBS(&buf_[strlen(buf_)], end_src, MAX_USER_INPUT);
    candidate_flag = true;
}

Generated by  Doxygen 1.6.0   Back to index